Koa-Routr
A simple easy to use router for Koa. If you are familiar to express' router then this should be second nature to use.
Install
npm i koa-routr
Usage
It's as simple as bellow:
const koa = const koaRoutr = const app = const router = appapp router router router router
Version 5
As of version 5 params are no longer passed into the route handle they are
accessible on the context
and context.request
:
router
And there is middleware (which you can use
to structure further routers)
const app = const router = appapp router const nestedRouter = nestedRouter router
Now it is possible to create a new router at a mounted point, which reduces the above example to the following:
const app = const router = appapp router router
Licence
MIT