cravler / koa-find-my-way

Router middleware for koa.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

koa-find-my-way

Router middleware for koa.

Installation

$ npm install koa-find-my-way

Usage

const Koa = require('koa');
const Router = require('koa-find-my-way');

const app = new Koa();
const router = new Router();

router.get('/:name', async (ctx, next) => {
    const { params, store } = ctx;
    ctx.body = 'Hello ' . (params['name'] || 'World');
});

app.use(router.lookup());

app.listen(3000);

License

This software is under the MIT license. See the complete license in:

LICENSE

About

Router middleware for koa.

License:MIT License


Languages

Language:JavaScript 100.0%