v3rt1g0
v3rt1g0

Reputation: 43

node.js - replace PHP, and asynchronously connect to it

Recently I started playing with node.js.

Since I'm developing a web app, I was interested in the benefits of google's javascript V8 engine, i started reading stuff about all this - and node.js.

An example of a webapp which uses node.js: http://bodesigns.com/simple-web-app-using-node-js/

As you can see, it uses node.js to connect to a mysql database. Some questions about this: - First of all, is this safe? I mean: the username and password are stored in the file. I know, in PHP it is to, but a PHP-file is server-side. Node.js is server-side?

Upvotes: 1

Views: 1314

Answers (1)

Raynos
Raynos

Reputation: 169471

First of all, is this save?

node.js runs on the server, the code doesn't need to go to the client so it's safe.

What are the (dis)advantages of replacing the PHP-code with node.js code?

Do you need to rewrite code that already works? If your writing new code then PHP vs node.js is a completely different and application specific discussion. For generic applications they are both suitable

Is this possible?

Yes, however it's also possible with PHP.

Upvotes: 3

Related Questions