12.0.1 • Published 6 months ago

@koa/router v12.0.1

Weekly downloads
151,893
License
MIT
Repository
github
Last release
6 months ago

@koa/router

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

build status code style 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 @types/koa__router

API Reference

See API Reference for more documentation.

Contributors

Name
Alex Mingoia
@koajs

License

MIT © Alex Mingoia

@strapi/strapi@kbox/serverauto-import-router@budibase/server@budibase/workerwidget-like-button-testryoma_rss@sparrowjs/corereact-antd-ssr-spa-demokoa-controller-examplefilmstory.server@backyard/dev-serverkoa-router-file-basedkoa-webserver-file-based@eviljs/std-restexample-app-koasql-tag-system-koa-routesql-arbitrary-category-system-koa-routesql-bookmark-system-koa-routeretool-proxyrugo-corevscode-test-webts-lib-skeleton@kolibrejs/core@peregrine/koa-with-decorators@vifjs/kitshopify-better-exporterkoalikoatt@lc-cn/oicq-bots@lc-cn/oicq-platformwebsrv@hakushin/dev-consolekoify@oitq/service-http-server@oitq/plugin-http-serveroitqoicq-onebotdigitalhuman-eventmodule@service-exchange/serverwholesale-forwarding@infinitebrahmanuniverse/nolb-_koa@zhinjs/plugin-httpmacreoclymene@chasi/clientdrafterbitconcise-familyliusc-creator@4hermes/lib-sharedrsshubbilibili-login-js@everything-registry/sub-chunk-523@artusx/plugin-application-httpdt-routing-controllerseffectsloop-server-utilsept-toolselm-spec-runnereol-commons-koaempidying-uifiles-sharefixly-servereterniaethereum-antennaexample-complete-koatime-line-prolink@eviljs/node-rest@fusebit-int/frameworkfmanfixee-servergaea-open-source-fppcligamewallfroyo-apifroyov2joi-router-safezxt-midway3-corekoa-controlkoa-controller-registerkoa-openapi-routerkoa-openid-clientkoa-msckoa-suitkoa-suitekoa-swagger-decoratorkoa-swagger-decorator-1koa-swagger-decorator-xkoa-swagger-decorator2koa-toolkit@galaxar/serverkoa-abstract-routekoa-router-utilkoa-router-decorators-pluskoa-router-decorators-upkoa-sailorkoa-route-loaderkoalandzy-log-querykoa-gcskoa-joi-router-alt
12.0.1

6 months ago

11.0.2

6 months ago

12.0.0

2 years ago

11.0.0

2 years ago

11.0.1

2 years ago

10.1.1

3 years ago

10.1.0

3 years ago

10.0.0

3 years ago

9.4.0

4 years ago

9.3.1

4 years ago

9.3.0

4 years ago

9.2.0

4 years ago

9.1.0

4 years ago

9.0.1

4 years ago

9.0.0

4 years ago

8.0.8

4 years ago

8.0.7

4 years ago

8.0.6

4 years ago

8.0.5

4 years ago

8.0.4

4 years ago

8.0.3

4 years ago

8.0.2

5 years ago

8.0.1

5 years ago

8.0.0

5 years ago