koa-router

Router middleware for koa. Maintained by Forward Email and Lad.

koa-router downloads koa-router version koa-router license

koa-routerSimilar Packages:
Npm Package Weekly Downloads Trend
3 Years
🌟 Show real-time usage chart on koa-router's README.md, just copy the code below.
## Usage Trend
[![Usage Trend of koa-router](https://npm-compare.com/img/npm-trend/THREE_YEARS/koa-router.png)](https://npm-compare.com/koa-router#timeRange=THREE_YEARS)
Cumulative GitHub Star Trend
🌟 Show GitHub stars trend chart on koa-router's README.md, just copy the code below.
## GitHub Stars Trend
[![GitHub Stars Trend of koa-router](https://npm-compare.com/img/github-trend/koa-router.png)](https://npm-compare.com/koa-router)
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
koa-router416,09490134.3 kB213 months agoMIT
README for koa-router

@koa/router

Router middleware for Koa. Maintained by Forward Email and Lad.

build status

styled with prettier made with lass license

Table of Contents

Features

  • Express-style routing (app.get, app.put, app.post, etc.)
  • Named URL parameters
  • Named routes with URL generation
  • Match routes with specific host
  • Responds to OPTIONS requests with allowed methods
  • Support for 405 Method Not Allowed and 501 Not Implemented
  • Multiple route middleware
  • Multiple and nestable routers
  • async/await support

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 .use() (or .get(), etc.), which matches Express 4 API.

Install

npm:

npm install @koa/router

Typescript Support

npm install --save-dev @types/koa__router

API Reference

See API Reference for more documentation.

Contributors

| Name | | ---------------- | | Alex Mingoia | | @koajs | | Imed Jaberi |

License

MIT © Alex Mingoia