feat(server): plugins can add middlewares and routes (#1455)

Co-authored-by: RoeHH <git@roeh.ch>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
This commit is contained in:
Reed von Redwitz
2023-07-13 11:26:07 +02:00
committed by GitHub
co-authored by RoeHH Marvin Hagemeister
parent 7dee138bee
commit 50db296fb7
10 changed files with 171 additions and 4 deletions
@@ -0,0 +1,7 @@
import { MiddlewareHandlerContext } from "$fresh/server.ts";
export async function handler(_req: Request, ctx: MiddlewareHandlerContext) {
ctx.state.test = "look, i'm set from a plugin!";
const resp = await ctx.next();
return resp;
}