Skip to content

RESTful APIs boilerplate in Node.js with Express and Mongoose

Notifications You must be signed in to change notification settings

kmsbernard/restful-mongoose-express

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTful Mongoose Express

A simple boilerplate application for building RESTful APIs in Node.js with Express and Mongoose.

Features

  • ECMAScript 6 language standard
  • Express web framework
  • mongoose mongoDB object modeling
  • passport authentication middleware
  • bcrypt password hashing
  • JSON Web Token access control
  • bluebird promise library
  • Mocha & Chai test
  • webpack module bundler
  • nodemon live reload
  • dotenv managing environment variables

Scripts

  • npm run dev run server in development mode, enabling live reload
  • npm run build compile for production
  • npm run start run server with production build
  • npm run test run mocha tests

Setting

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.

Run

  1. Prepare MongoDB
  2. npm install
  3. Set environment variables, if you need
  4. npm run test, if you want
  5. npm run dev

Milestones

  • Paginate respone
  • Social OAuth

About

RESTful APIs boilerplate in Node.js with Express and Mongoose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published