node.js data service development
To create user in MongoDB:
- Login as admin
mongo admin --username root --password PWD
Find root PWD in Amazon EC2 console > Actions > Instance Setting > Get System Log
-
db = db.getSiblingDB('testDB')
db.createUser({user:"USER", pwd:"PWD", roles: ["readWrite"]})
-
Login as new user
mongo testDB --username USER --password PWD
Install forever package:
npm install forever -g
Start/stop:
forever start bin/www
forever stop bin/www