This NodeJS starter project is a collection of best practices. It enables the user to copy and use the source within this repo as a starting point when builiding NodeJS apis.
- Install dependencies
$ npm install
- Copy .env.example into .env and update values
- Run
$ npm build
this will transpile with Babel and output to build/Release
- Run
$ npm startd
this will run via babel-node on source - Run
$ npm start
this will run from the build/Release folder
Method | Route | Body |
---|---|---|
GET | /api/users/ | - |
GET | /api/users/:id | - |
POST | /api/users/ | { "name": "New Name" } |
PUT | /api/users/:id | { "name": "Update Name" } |
DELETE | /api/users/:id | - |
- To run test
$ npm test
- Separation of concerns within the app (See file structure)
- Clean entry point (See server.js)
- Use of environment for configuration
- Sample tests
- Sample custom middleware
- Sample error handling
- ES6 - Babel transpiling