circe-body-parser
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

circe-body-parser 请求体解析

支持jsontextform类型

安装

NPM

使用

import * as Koa from 'koa'
import bodyParser from 'circe-body-parser'
 
const app = new Koa()
 
app.use(bodyParser())
 
app.use(async (ctx) => {
  ctx.body = ctx.request.body
})

参数

  • onError?: (err: Error, ctx: Koa.Context) => void
  • encoding?: string = 'utf-8'
  • jsonLimit?: string = '1mb'
  • formLimit?: string = '56kb'
  • textLimit?: string = '56kb'
  • multipart?: boolean = false
  • formidableOptions?: IIncomingFormOptions = {}
    • 参考:formidable
    • encoding?: string
    • uploadDir?: string
    • keepExtensions?: boolean
    • maxFieldsSize?: number
    • maxFields?: number
    • hash?: string | boolean
    • multiples?: boolean
    • type?: string
    • bytesReceived?: number
    • bytesExpected?: number

Readme

Keywords

none

Package Sidebar

Install

npm i circe-body-parser

Weekly Downloads

0

Version

0.0.5

License

MIT

Last publish

Collaborators

  • sikichan2
  • varharrie