This is a template for a backend server running Express and Mongoose.
It was made for my friend lilytastic.
Configuration can be set be editing config.js
. Ideally, you would load these values from environmental variables, or a .env file.
To run the project, you can use either npm start
or node .
.
If you want to do some debugging, you can use node --inspect .
or node --inspect-brk .
and connect with your preferred debugger. I recommend using Chrome's dedicated DevTools for Node.
I used express-promise-router
and return promises from each of my routes because makes error handling a lot cleaner. You can throw errors created by the http-errors
module and they will be handled nicely by middleware/httpErrorHandler
.
A Postman collection is available for this API:
- Open Postman
- Click the "Import" button
- Click the "Import From Link" tab
- Paste this link
- Click "Import"