Multer is a node.js middleware for handling
multipart/form-data
for koa.
multer wrapper for koa's middleware.
$ npm install --save koa-multer
const Koa = require('koa');
const route = require('koa-route');
const multer = require('koa-multer');
const app = new Koa();
const upload = multer({ dest: 'uploads/' });
app.use(route.post('/profile', upload.single('avatar')));
app.listen(3000);
multer-v0.x
(v0.1.8 is the latset version of v0.x) and koa-v1.xvar koa = require('koa');
var multer = require('koa-multer');
var app = koa();
app.use(multer({ dest: './uploads/'}));
app.listen(3000);