1.0.0 • Published 8 years ago

bifroster-agent-router v1.0.0

Weekly downloads
6
License
-
Repository
github
Last release
8 years ago

bifrost-agent-router

npm install --save bifroster-agent-router

Usage

router.js

const Router = require('bifroster-agent-router');
const route = module.exports = new Router();
route.receive('/:id(\\d+)', async ctx => {
  ctx.send({
    a: 1,
    b: 2,
    c: ctx.params.id
  })
})

index.js

const router = require('./router');
module.exports = channel => {
  channel.use(router.routes());
}
1.0.0

8 years ago