feat: middleware can call renderNotFound (#1975)

This commit is contained in:
Reed von Redwitz
2023-10-27 23:34:49 +02:00
committed by GitHub
parent 67c795731d
commit f5dd55443b
8 changed files with 275 additions and 199 deletions
@@ -8,7 +8,10 @@ export default function secondMiddlewarePlugin(): Plugin<
name: "secondMiddlewarePlugin",
middlewares: [{
middleware: {
handler: async (_req: Request, ctx: MiddlewareHandlerContext) => {
handler: async (
_req: Request,
ctx: MiddlewareHandlerContext<PluginMiddlewareState>,
) => {
return await ctx.next();
},
},
@@ -26,7 +29,10 @@ export default function secondMiddlewarePlugin(): Plugin<
path: "lots-of-middleware/",
}, {
middleware: {
handler: async (_req: Request, ctx: MiddlewareHandlerContext) => {
handler: async (
_req: Request,
ctx: MiddlewareHandlerContext<PluginMiddlewareState>,
) => {
return await ctx.next();
},
},