Node.js + Nginx – What now?

Nginx works as a front end server, which in this case proxies the requests to a node.js server. Therefore you need to setup an nginx config file for node. This is what I have done in my Ubuntu box: Create the file yourdomain.com at /etc/nginx/sites-available/: In it you should have something like: If you want nginx (>= 1.3.13) … Read more

Enabling HTTPS on express.js

In express.js (since version 3) you should use that syntax: In that way you provide express middleware to the native http/https server If you want your app running on ports below 1024, you will need to use sudo command (not recommended) or use a reverse proxy (e.g. nginx, haproxy).

Basic Ajax send/receive with node.js

Your request should be to the server, NOT the server.js file which instantiates it. So, the request should look something like this: xmlhttp.open(“GET”,”http://localhost:8001/”, true); Also, you are trying to serve the front-end (index.html) AND serve AJAX requests at the same URI. To accomplish this, you are going to have to introduce logic to your server.js that will … Read more

Unable to connect to mongolab, Getting MongoError: auth failed

Make sure you are using the database username and password not the account username and password from Mlab. In MLab, formerly MongoLab, do the following Navigate to Users Add Database User Choose your username and password Now you can test this on the shell with mongo ds061374.mlab.com:61374/yourdb -u <dbuser> -p <dbpassword>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)