import { MiddlewareHandlerContext } from "$fresh/server.ts"; interface State { data: string; } export async function handler( _: Request, ctx: MiddlewareHandlerContext, ) { ctx.state.data = "myData"; const resp = await ctx.next(); resp.headers.set("server", "fresh server"); return resp; }