Minimalist Wrapper of multer, for koa-router
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
History.md
LICENSE
README.md
index.js
package.json

README.md

koa-router-multer

Wrapper of koa-multer, for koa-router.

Tested with Koa 2.x, should work with Koa 1.x as well.

Codacy Badge Build Status Dependency Status devDependency Status license

Install

$ npm install --save koa-router-multer

Usage

Import the module

import multer from 'koa-router-multer';

Set the upload folder for file uploads

var upload = multer({ dest: 'uploads/' });

Example of resource

route.post('/upload', upload.single('file'), function * (next) {
  var filename = this.req.file.filename;
  var mimeType = this.req.file.mimetype;
  ...
  ...
});

See more, koa-multer

License

MIT