mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
Merge pull request #31890 from Guillaume-Mayer/koa-router-fix-context
[koa-router] fix IRouterContext
This commit is contained in:
Vendored
+1
-1
@@ -43,7 +43,7 @@ declare namespace Router {
|
||||
strict?: boolean;
|
||||
}
|
||||
|
||||
export interface IRouterContext {
|
||||
export interface IRouterContext extends Koa.Context {
|
||||
/**
|
||||
* url params
|
||||
*/
|
||||
|
||||
@@ -49,6 +49,10 @@ const match = router.match('/users/:id', 'GET');
|
||||
let layer: Router.Layer
|
||||
let layerOptions: Router.ILayerOptions
|
||||
|
||||
const mw: Router.IMiddleware = (ctx: Router.IRouterContext, next: () => Promise<any>) => {
|
||||
ctx.body = "Ok";
|
||||
};
|
||||
|
||||
app.use(router.routes());
|
||||
app.use(router.allowedMethods());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user