This is a straightforward boilerplate for building REST APIs with ES6 and Express.
- ES6 support -> babel
- REST resources as middleware -> resource-router-middleware
- CORS support -> cors
- helmet Helmet helps to secure Express apps by setting various HTTP headers -> helmet
- body parsing -> body-parser
- nconf -> nconf
- winston logger -> winston
- express-winston logger middleware for express -> express-winston
- winston-mail send logs to mail -> winston-mail
- jest unit testing framework -> jest
- supertest Super-agent driven library for testing node.js HTTP servers using a fluent API -> supertest
Tip: If you are using Mongoose, you can automatically expose your Models as REST resources using restful-mongoose.
# Install dependencies
npm install
# Setup nconfig
go to index.js & config.json and setup the vars
# Start development live-reload server
npm run dev
# Start production server:
npm start
cd node-rest-es6-boilerplate
# Build your docker
docker build -t es6/api-service .
# ^ ^ ^
# tag tag name Dockerfile location
# run your docker
docker run -p 8080:8080 es6/api-service
# ^ ^
# bind the port container tag
# to your host
# machine port
MIT