Router middleware for koa. Provides RESTful resource routing.@koa/router
Router middleware for koa
- Express-style routing (
- Named URL parameters
- Named routes with URL generation
- Responds to
OPTIONSrequests with allowed methods
- Support for
405 Method Not Allowedand
501 Not Implemented
- Multiple route middleware
- Multiple and nestable routers
Migrating to 7 / Koa 2
- The API has changed to match the new promise-based middleware signature of koa 2. See the koa 2.x readme for more information.
- Middleware is now always run in the order declared by
.get(), etc.), which matches Express 4 API.
Install using npm:
npm install @koa/router
Please submit all issues and pull requests to the koajs/router repository!
Run tests using
If you have any problem or suggestion please open an issue here.
Call for Maintainers
This module is forked from the original koa-router due to its lack of activity.
koa-router is the most widely used router module in the Koa community and we need maintainers. If you're interested in fixing bugs or implementing new features feel free to open a pull request. We'll be adding active contributors as collaborators.
Thanks to the original authors @alexmingoia and the original team for their great work.