- MongoDB 3.2
- Redis
- Node.js version 5.0 to 6.4.0
-
Download zip
-
Make sure redis server is running in correct PORT and HOST
$ redis-server
- Run this commands to get started:
$ sudo npm i -g forever
$ sudo npm i -g nodemon
$ sudo npm install
- To run the server using nodemon:
$ nodemon server.js
- Using cluster:
$ nodemon cluster.js
$ forever start cluster.js
- After starting the server, run this commands to check:
$ curl http://localhost:8000
- To get apidocs
$ npm run docs
Then check localhost:8000/apidoc/
.
├── assets
├── config
└── env
├── controllers
├── database
├── helpers
├── lib
├── logs
├── test
└── controllers
├── uploads
└── views
- assets -- where you place img, css, bower_components, fonts
- helpers -- js files for reusable methods
- uploads -- where users can upload files, and images
- views -- where templates are placed
- others are self explanatory I guess
Controllers are the heart of your application, as they determine how HTTP requests should be handled. They are located at the controllers
folder. They are not automatically routed. You must explicitly route them in config/router.js
. Using sub-folders for file organization is allowed.
MIT