koa-router-multer
v1.3.0
Published
Middleware for handling `multipart/form-data` for koa-router
Downloads
81
Maintainers
Readme
koa-router-multer
Wrapper of koa-multer, for koa-router.
Tested with Koa 2.x, should work with Koa 1.x as well.
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