A tiny yet overengineered RESTful api to sample a few libraries.
- Express
- Bunyan
- Convict
- Mongoose
- Mocha / Chai / Supertest
I've setup rotating logs using Bunyan, configured with multiple logging levels and output streams.
Each inbound request has a child logger attached to it, any logs made using this will automatically record its request id.
Every request has its parameters and responses logged via express middleware.
A good starting point for APM integration.
utils/logging.js
.
Convict provides a schema and access method for environment variables.
utils/config.js
.
All errors are forwarded to a custom error handler, which consistently detects and formats all mongoose errors.
utils/mongoose-error-hander.js
.