UNPKG

@workablehr/riviere

Version:

log inbound/outbound HTTP traffic

22 lines (17 loc) 369 B
const Koa = require('koa'); const riviere = require('../index'); const app = new Koa(); app.use( riviere({ errors: { callback: (err, ctx) => { // eslint-disable-next-line no-console console.error(`ERROR at ${ctx.path}:`, err); } } }) ); app.use(function() { throw new Error('something bad happened'); }); app.listen(3000);