Router middleware for Koa v2 that supports Express-like HTTP verb methods (get, post, put, delete, all), param middleware, automatic OPTIONS/HEAD responses, 501/405 status codes with headers, and a plugin system for injecting middleware via config objects. It allows mounting routers on paths, supports multiple middleware as arguments or arrays, and can throw errors with status codes. Version 1.0.1 is the latest stable release, targeting Node >= 4. Alternatives like koa-router are more actively maintained.
npm install koa-66Verified import paths — ran on the pinned version, not inferred.
Creates a basic Koa app with a single GET route using koa-66 router.
Use `new Router()` instead of `Router()`.
Consider using koa-router or @koa/router which are actively maintained.
Use `const Router = require('koa-66')` instead of `import Router from 'koa-66'`.Ensure `router.mount('/prefix', subRouter)` is used correctly.Check that no other middleware sets ctx.state.plugins before using plugins.
Use `new Router()` instead of `Router()`.
Use `const Router = require('koa-66'); const router = new Router();`Run `npm install koa-66` to install the package.
Ensure you create a new Router instance: `const router = new (require('koa-66'))()`No dependency data recorded yet.