feat: pass middleware state in props (#1264)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user