npm

Need private packages and team management tools?Check out npm Orgs. »

impress-router-table

1.5.0 • Public • Published

impress-router-table

Sails.js like routing for koa.js

Build Status Coverage Status npm version npm downloads npm license

Install

$ npm i impress-router-table --save

API

const routing = require('impress-router-table');

routing(rootdir, router)

returns a koa middleware

 
const app = new (require('koa'))
 
app.use(routing(__dirname + '/api'))
 
app.listen(9000)

router

router must support get / post / etc HTTP methods defaults to an new impress-router instance

Folder structure in rootdir

for example in previous example, __dirname + '/api', take a look at test/demo/api/

test/demo/api
├── controllers
│   ├── PolicyTestController.js
│   └── RouteTestController.js
├── policies
│   ├── auth.js
│   └── bar.js
├── policy.js # policy config
└── routes.js # routes config

2 directories, 6 files

Changelog

CHANGELOG.md

License

the MIT License http://magicdawn.mit-license.org

install

npm i impress-router-table

Downloadsweekly downloads

14

version

1.5.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability