koa-grace-router

1.0.37 • Public • Published

koa-grace-router

Build Status

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

Install

$ npm install koa-grace-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-grace-router');

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

app.listen(3000);

Test

npm test

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.371latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.371
1.0.360
1.0.35-rc11
1.0.350
1.0.340
1.0.330
1.0.320
1.0.310
1.0.302
1.0.290
1.0.280
1.0.270
1.0.260
1.0.251
1.0.240
1.0.230
1.0.220
1.0.210
1.0.200
1.0.190
1.0.180
1.0.170
1.0.160
1.0.150
1.0.140
1.0.130
1.0.120
1.0.110
1.0.100
1.0.90

Package Sidebar

Install

npm i koa-grace-router

Weekly Downloads

5

Version

1.0.37

License

MIT

Last publish

Collaborators

  • xiongwilee