2022-09-27 14:41:17 -05:00
|
|
|
import { MiddlewareHandlerContext } from "$fresh/server.ts";
|
|
|
|
|
|
|
|
interface State {
|
|
|
|
data: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function handler(
|
|
|
|
_: Request,
|
|
|
|
ctx: MiddlewareHandlerContext<State>,
|
|
|
|
) {
|
|
|
|
ctx.state.data = "myData";
|
|
|
|
const resp = await ctx.next();
|
2022-09-27 15:49:41 -05:00
|
|
|
if (resp) resp.headers.set("server", "fresh server");
|
2022-09-27 14:41:17 -05:00
|
|
|
return resp;
|
|
|
|
}
|