feat: pass middleware state in props (#1264)

This commit is contained in:
Reed von Redwitz
2023-06-28 14:53:42 +02:00
committed by GitHub
parent 851f8d60aa
commit 0db3a0911a
12 changed files with 105 additions and 20 deletions
@@ -0,0 +1,10 @@
import { MiddlewareHandlerContext } from "$fresh/server.ts";
export async function handler(
_req: Request,
ctx: MiddlewareHandlerContext,
) {
ctx.state.stateInProps = "look, i am set from middleware";
const resp = await ctx.next();
return resp;
}