安装
npm install lipo-koa
yarn add lipo-koa
pnpm add lipo-koa
bun add lipo-koa
README

lipo-koa

build status code coverage code style styled with prettier made with lass license

Lipo middleware for Lad and Koa

Table of Contents

Install

npm:

npm install lipo-koa

yarn:

yarn add lipo-koa

Usage

const Koa = require('koa');
const multer = require('koa-multer');
const bytes = require('bytes');
const errorHandler = require('koa-better-error-handler');
const lipoKoa = require('lipo-koa');

const app = new Koa();

const upload = multer({
  limits: {
    fieldNameSize: bytes('100b'),
    fieldSize: bytes('1mb'),
    fileSize: bytes('5mb'),
    fields: 10,
    files: 1
  }
});
app.use(upload.single('input'));

// override koa's undocumented error handler
app.context.onerror = errorHandler;

// specify that this is our api
app.context.api = true;

// use lipo's koa middleware
app.use(lipoKoa);

// start server
app.listen(3000);

Contributors

Name Website
Nick Baugh http://niftylettuce.com/

License

MIT © Nick Baugh

版本列表
0.1.5 2019-12-10
0.1.4 2019-12-09
0.1.3 2019-11-29
0.1.2 2019-11-27
0.1.1 2019-01-09
0.1.0 2019-01-09
0.0.3 2017-11-30
0.0.2 2017-11-26