fix(server): Improve MiddlewareHandler type for plugins (#1534)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { MiddlewareHandlerContext } from "$fresh/server.ts";
|
||||
|
||||
export async function handler(_req: Request, ctx: MiddlewareHandlerContext) {
|
||||
export async function handler(
|
||||
_req: Request,
|
||||
ctx: MiddlewareHandlerContext<{ test: string }>,
|
||||
) {
|
||||
ctx.state.test = "look, i'm set from a plugin!";
|
||||
const resp = await ctx.next();
|
||||
return resp;
|
||||
|
||||
Reference in New Issue
Block a user