This is a boilerplate for building RESTful APIs with NodeJS.
- ES6 support via babel
- REST resources as middleware via resource-router-middleware
- CORS support via cors
- Body Parsing via body-parser
- Testing via Mocha
- Follows RESTful API best practices from @GaboEsquivel
- TODO: JWT Authentication inspired by Chris Sevilleja at scotch.io
# clone it
git clone git@github.com:developit/express-es6-rest-api.git
cd express-es6-rest-api
# Make it your own
rm -rf .git && git init && npm init
# Install dependencies
npm install
# Start development live-reload server
PORT=8080 npm run dev
# Start production server:
PORT=8080 npm start- ✅ Add version information to endpoint path /api/v0/
- ✅ Change example endpoint to /posts
- ✅ Add sample data for /posts
- ✅ Create Mocha tests for example endpoint
- ✅ Respond with 201 and Location header for successful POST requests
- ⬜ Add folder structure to README
- ⬜ Add test to build step in packages.json
- ⬜ Rename project to nodejs-rest-api-boilerplate
- ⬜ Update README for example Posts endpoint - /docs/example
- ⬜ Update README for tests - /docs/tests
- ⬜ Create POSTman README - /docs/postman
- ⬜ Create cURLS README - /docs/curl
- ⬜ Add Docker support with Nginx and SSL
- ⬜ Implement JWT authentication https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens
- ⬜ Add example code for searching with parameters at GET endpoint
- ⬜ Update REAMDE with best practices reference http://gaboesquivel.com/blog/2015/best-practices-for-designing-web-apis/
- ⬜ Create /authors example endpoint
- ⬜ Update README
- ⬜ Create test
- ⬜ Create subroute example - /authors/:id/posts
- ⬜ Update README
- ⬜ Create test
- ⬜ Return Links with GET /authors endpoint to related posts in res.Links[0...n].href
- ⬜ Standardize format of error responses with JSON and meaningful messages
- ⬜ Add params/querystring based logic to example - /posts?author=Superman
- ⬜ Update README
- ⬜ Create test
- ⬜ Provide inline API documentation with examples http://apidocjs.com/
- ⬜ Implement uuid.v4() for ids in sample data and POST logic
- ⬜ Move db to importable/global resource for access from /models directory
- ⬜ Provide Heroku deployment example
This project was forked from https://github.com/developit/express-es6-rest-api.
MIT