Name: koa-final-handler
Owner: YOCTOL INFO INC.
Description: Final handler middleware for koa.
Created: 2018-05-05 16:03:55.0
Updated: 2018-05-14 07:18:57.0
Pushed: 2018-05-14 07:18:56.0
Homepage: null
Size: 53
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Final handler middleware for koa
Install using npm:
install @yoctol/koa-final-handler
t Koa = require('koa');
t finalHandler = require('@yoctol/koa-final-handler');
t app = new Koa();
use(finalHandler());
sing other middleware after this line */
use(auth());
use(route());
listen(8080, () => {
nsole.log('server is running on http://localhost:8080');
The middleware will append error object on response body when NODE_ENV
is development
.
t { error } = response.body;
t handleErrorReporting = (error, ctx) => {
your error reporting handler */
on('error', handleErrorReporting);