404 handler for Lad and Koa (best used with koa-better-error-handler)
npm:
npm install koa-404-handler
yarn:
yarn add koa-404-handler
const errorHandler = require('koa-better-error-handler');
const koa404Handler = require('koa-404-handler');
// ...
// override koa's undocumented error handler
app.context.onerror = errorHandler;
// ... routes go here ...
app.use(koa404Handler);
app.listen();
Name | Website |
---|---|
Nick Baugh | http://niftylettuce.com/ |