- runs on node.js v5.11.1 / node.js v6
- express 4+
- heroku
- eslint
- mongodb
- POSTMAN chrome extension for verification
- Edit configuration in
config/default.json
and - custom environment variables names in
config/custom-environment-variables.json
, - for example it will read MONGODB_URI as url of database from heroku.
Following variables can be configured:
authSecret
the secret for authport
the port to listenlogLevel
the log leveldebug
orinfo
version
the version of apiMONGODB_URI
the mongo database URI
-
You will need to install Heroku Toolbelt for this step if you don't already have it installed.
-
In the main project folder, run the following commands:
heroku login git init git add . git commit -m "init" heroku create heroku addons:create mongolab:sandbox git push heroku master heroku logs -t heroku open
- Please make sure to configure url of database rightly in
config/default.json
or use environment variable MONGODB_URI. - Install dependencies
npm i
- run lint check
npm run lint
- Start app
npm start
- Load postman collection:
- endpoints: docs/api.postman_collection.json
- environment: docs/api.postman_environment.json
- It will use passport and it could support social feature to login as twitter, facebook easily.
- It will use
src/app-passport.js
to load passport strategies in src/passports, you can defineauth:{name of passport strategy}
inroutes.js
of module. - You can also define
access:[role1,role2]
, the user role name is fromsrc/constants.js
. - It will check Authentication & Authorization in
src/app-routes.js
to secure the APIs.