Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 759 Bytes

production.md

File metadata and controls

53 lines (37 loc) · 759 Bytes

Production

Some recommendations for running in production environments.

Installation

Nginx and Git method (recommended)

> npm install -g cs
> git clone {{yourapp}} /your/app/dir
> cd /your/app/dir
> npm install

If you aren't using GIT, just copy your files to your server manually then npm install

Add your Nginx Rule (Assumes your production port is 3000)

server {
	listen 80;
	server_name {{yourDomain.com}}
	location / {
		proxy_pass	http://127.0.0.1:3000/;
	}
}

Install forever

npm install -g forever

Restart Nginx

> /etc/init.d/nginx restart

How to run

forever start -c "node --harmony" index.js production

How to restart

forever restart index.js