This package has been deprecated

Author message:

this package has been deprecated

koa-mountify

0.1.5 • Public • Published

koa-mountify

MIT license build status coverage status npm version npm download dependency status

Mount directory as middleware.

**/*.js will be required and mounted according to path.

Inspired by express-enrouten and koa-mount.

install

$ npm install --save koa-mountify

example

var koa = require("koa");
var app = koa();

var join = require("path").join;
var mountify = require("koa-mountify");
app.use(mountify(join(__dirname, "route")));

// similar to
// var mount = require("koa-mount");
// app.use(mount("/", require("./route/index")));
// app.use(mount("/foo", require("./route/foo")));
// app.use(mount("/foo/bar", require("./route/foo/bar")));

View the examples directory for working examples.

options

mountify(dir);
mountify(path, dir);
  • /pathname/index.js will be mounted to /pathname/
  • module in dir MUST retrun a middleware or array of middleware.

develop

debug

$ DEBUG=koa-mountify node --harmony example/app.js

test

$ npm test

coverage

$ npm run cover

license

MIT

Package Sidebar

Install

npm i koa-mountify

Weekly Downloads

0

Version

0.1.5

License

MIT

Last publish

Collaborators

  • npm