router icon indicating copy to clipboard operation
router copied to clipboard

Router middleware for Koa. Maintained by @forwardemail and @ladjs.

Results 29 router issues
Sort by recently updated
recently updated
newest added

## Checklist - [x] I have ensured my pull request is not behind the main or master branch of the original repository. - [x] I have rebased all commits where...

## Describe the bug **Node.js version:** Node v16.15.1 **OS version:** MacOs Ventura Version 13.3.1 (a) **Description:** When multiple routes match, the router doesn't seems to execute the right controller without...

bug

`node.js` version: `16.2.0` `yarn` version: `1.22.10` `@koa/router` version: `10.0.0` `koa` version: `2.13.1` #### Code sample: ```ts let usersRouter = new Router() .use(async (ctx, next) => { console.log(ctx.params.userId ?? 'No user...

The `allowedMethods` middleware has a `throw` option, I'd like to add the same to `routes`. For now I have a custom middleware (https://github.com/libero/article-store/blob/master/src/middleware/routing.ts), but it'd be great to have it...

``` // 查询所有用户 router.get("/users", async (ctx, next) => { const sql = "SELECT * FROM users" connection.query(sql, (err, results, fields) => { if (err) { console.error(err) ctx.body = { success:...

enhancement

I use Koa @koa/router to serve multiple routers from the same webserver. Each router serves one or more domains, sometimes including specific subdomains. My suggestion is to enhance the type...

enhancement

`@koa/router` version: 10.1.1 `koa` version: 2.13.4 #### Code sample: In express route if we want to match multiple verbs with the same route we could provide the following syntax ```...

Change `this` binding of param handler call to the middleware itself, allowing access to param name. This allows for generic param middleware that can be re-used for multiple params. ##...