-
Notifications
You must be signed in to change notification settings - Fork 6
About
All API routes are under the meMiddleware
It enables using me as userId in route parameters to refer to the user currently logged in
router.get('users/:userId');
// GET /users/me
Code styling is handled by eslint
We're using the AirBnb configuration extended for typescript. It will ensure coherence across the whole codebase, and make sure you're following general good practices
Use npm run lint
to check coding style and automatically fix errors
The application comes with a custom logger made with winston.
It allows you to output nicely formated logs as simply as
logger.info('Server listening on 8000')
Error logs are written into logs/error.log
, and a mix of all logs level from info are written into logs/all.log
In production mode, logs are not written in stdout
, only in files
This is essential as console.log is a blocking operation
It reduces the IO usage too
Additionally, all requests are automatically logged too, thanks to morgan
Coming soon