1.0.9 • Published 10 years ago

koa-hornbill-router v1.0.9

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

koa-hornbill-router

File/Folder as path, another router middleware for koa.

Install

$ npm install koa-hornbill-router --save

Usage

router(app, options)
  • app: {Object} koa instance.
  • options: {Object|String->root}
    • root: {String} router directory

Example

File tree

├── app.js
└── controller
    ├── deal
    │   ├── index.js
    │   └── refund.js
    ├── index.js
    └── test.js

app.js

var koa = require('koa');
var router = require('koa-hornbill-router');

app.use(router(app, {
  root: './example/controller'
}));

app.listen(3000);

Test

npm test

License

MIT

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago