A simple boilerplate application for building RESTful APIs in Node.js with Express and Mongoose.
ECMAScript 6
language standardExpress
web frameworkmongoose
mongoDB object modelingpassport
authentication middlewarebcrypt
password hashingJSON Web Token
access controlbluebird
promise libraryMocha
&Chai
testwebpack
module bundlernodemon
live reloaddotenv
managing environment variables
npm run dev
run server in development mode, enabling live reloadnpm run build
compile for productionnpm run start
run server with production buildnpm run test
run mocha tests
Set environment-specific variables on .env
file in the root directory of the project.
PORT=8000
DB_HOST=mongodb://localhost/database
TEST_DB_HOST=mongodb://localhost/database-for-test
JWT_SECRET=jasonwebtokensecret
JWT_EXPIRES_IN=7d
BCRYPT_SALT_ROUND=10
See /src/config.js
how it actually affects configuration.
- Prepare MongoDB
npm install
- Set environment variables, if you need
npm run test
, if you wantnpm run dev
- Paginate respone
- Social OAuth