Socket
Socket
Sign inDemoInstall

koa-router

Package Overview
Dependencies
11
Maintainers
2
Versions
90
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    koa-router

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


Version published
Weekly downloads
441K
increased by3.5%
Maintainers
2
Install size
263 kB
Created
Weekly downloads
 

Readme

Source

@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 --save-dev @types/koa__router

API Reference

See API Reference for more documentation.

Contributors

Name
Alex Mingoia
@koajs

License

MIT © Alex Mingoia

Keywords

FAQs

Last updated on 12 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc