Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

PaulRosset/formidable-upload-koa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

formidable-upload-koa

Travis Codecov

Koa middleware based on formidable uploader.

Formidable

Install

yarn add formidable-upload-koa

Usage

const koa = require("koa");
const Router = require("koa-router");
const koaForm = require("formidable-upload-koa");

const app = new koa();
const router = new Router();

const options = {
  uploadDir: `${__dirname}/`,
  keepExtensions: true
};

router.post("/uploader", koaForm(options), ctx => {
  // Access to
  // ctx.req.files
  // ctx.req.fields
  // The file has been uploaded in the folder choosen above.
});

app.use(router.routes());
app.listen(8080);

Test

yarn test

License

MIT

About

Koa middleware based on formidable uploader

Resources

License

Stars

Watchers

Forks

Packages

No packages published