1. koa-router
Router middleware for koa. Maintained by Forward Email and Lad.
koa-router
Package: koa-router
Created by: koajs
Last modified: Tue, 24 Oct 2023 14:45:41 GMT
Version: 12.0.1
License: MIT
Downloads: 1,902,741
Repository: https://github.com/koajs/router

Install

npm install koa-router
yarn add koa-router

@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

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code