Posted in Nodejs

NodeJS | Run a web page

$ forever start app.js

Advertisements
Posted in Device, Nodejs

Nodejs | Install external modules

For an effective development, some external modules are essential

First, install ‘npm’

$ sudo apt-get install npm

Second, install ‘ejs, jade, supervisor, forever, express’

$ npm install ejs jade

$ sudo npm install -g supervisor forever express
Posted in Nodejs

Nodejs | Operate web server whenever power on

Add below lines to ‘/etc/rc.local’

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000

node /home/ubuntu/landing_page/landing_page.js

 

External mobule is also available like ‘forever’ for settingĀ the server to execute nodejs script whenever the machine is on.