Koa middleware to log requests using the provided logger.
Initialise the module by providing a logger with error
and info
methods.
To log a request pass a koa
ctx object as a parameter after initialisation.
const myLogger = require('./logger');
const setupRequestLogger = require('@diegoh/api-request-logger');
const logRequest = setupRequestLogger(myLogger);
logRequest(ctx);
- Create a new branch from
master
with a name relevant to the changes you're making.git branch -b my-new-feature-description
- Push the branch and open a Pull Request (PR).
- Request a code review.
- Squash merge your commits and keep things tidy.
npm run test:unit
npm run test:coverage
npm run lint
or npm run lint:fix
to automatically fix any linting issues.
This project uses GitHub actions for CI/CD. The following secrets are required to publish this package.
NPM_TOKEN