@koa/router

Router middleware for koa. Provides RESTful resource routing.

**IMPORTANT 10x+ PERFORMANCE UPGRADE**: Please upgrade to v12.0.1+ as we have fixed an issue with debuglog causing 10x slower router benchmark performance, see https://github.com/koajs/router/pull/173
Last updated 6 years ago by niftylettuce .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @koa/router 
SYNC missed versions from official npm registry.

@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

Current Tags

  • 14.0.0                                ...           latest (8 months ago)

28 Versions

  • 14.0.0                                ...           8 months ago
  • 13.1.1                                ...           9 months ago
  • 13.1.0 [deprecated]           ...           2 years ago
  • 12.0.2                                ...           2 years ago
  • 13.0.1 [deprecated]           ...           2 years ago
  • 13.0.0 [deprecated]           ...           2 years ago
  • 11.0.2                                ...           2 years ago
  • 12.0.1 [deprecated]           ...           2 years ago
  • 12.0.0 [deprecated]           ...           4 years ago
  • 11.0.1 [deprecated]           ...           4 years ago
  • 11.0.0 [deprecated]           ...           4 years ago
  • 10.1.1 [deprecated]           ...           5 years ago
  • 10.1.0 [deprecated]           ...           5 years ago
  • 10.0.0 [deprecated]           ...           5 years ago
  • 9.4.0 [deprecated]           ...           6 years ago
  • 9.3.1 [deprecated]           ...           6 years ago
  • 9.3.0 [deprecated]           ...           6 years ago
  • 9.2.0 [deprecated]           ...           6 years ago
  • 9.1.0 [deprecated]           ...           6 years ago
  • 9.0.1 [deprecated]           ...           6 years ago
  • 8.0.8 [deprecated]           ...           6 years ago
  • 8.0.7 [deprecated]           ...           6 years ago
  • 8.0.6 [deprecated]           ...           6 years ago
  • 8.0.5 [deprecated]           ...           6 years ago
  • 8.0.3 [deprecated]           ...           6 years ago
  • 8.0.2 [deprecated]           ...           7 years ago
  • 8.0.1 [deprecated]           ...           7 years ago
  • 8.0.0 [deprecated]           ...           7 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (5)
Dev Dependencies (9)

Copyright 2013 - present © cnpmjs.org | Home |