circe-on-error
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

circe-on-error 错误处理

安装

NPM

使用

import * as Koa from 'koa'
import OnError from 'circe-on-error'
 
const app = new Koa()
 
app.use(onError((err, ctx) => {
  ctx.status = 500
  ctx.body = process.env.NODE_ENV === 'development'
    ? err.message
    : 'Internal Server Error'
}))

Readme

Keywords

none

Package Sidebar

Install

npm i circe-on-error

Weekly Downloads

2

Version

0.0.4

License

MIT

Last publish

Collaborators

  • sikichan2
  • varharrie