The demo is written as a node app, with a thin client written in handlebars and styling written with sass.
To get started/setup:
- Run
node -v
and ensure you have at least node v9.6.0 installed. - Run
npm install --dev
to install all the npm package dependencies. When installing in production omit the--dev
flag. - Run
node app.js
this will startup the server, which will default to run on port 3000. This can be set to an explicit port by runningnode app.js -p 80
which will run the app up on port 80.
All scripts rely on local npm modules therefore run npm install
before running the below scripts:
Will run the up the node server, listen on port 3000 and watch the following file types for changes. If a change is detected it will restart the server.
- *.js
- *.hbs
- *.scss
Will run all spec unit tests in jasmine.
Runs eslint
in ./
. Note the three .eslintrc.json
configs in:
- ./
- ./content/js
- ./spec
The simplest solution is to run the node app on port 80 by passing in the port number. If this isn't available/is reserved then you can use any of the following solutions.
See https://adamtuttle.codes/add-node-to-existing-iis-server/
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
sudo ipfw add 1 forward 127.0.0.1,3000 ip from any to any 80 in
Wondering how to keep the node server up if it ever crashes out for any reason?
- Install
forever
globally on the server usingnpm install forever -g
- Run
forever start app.js
- To view the list of processes running forever run
forever list
in your terminal - To stop a forever process run
forever stop {index-from-list}