import { Handlers, PageProps } from "$fresh/server.ts"; interface Data extends Record { info: string; } export default function Page({ data }: PageProps) { return
{data.info}
; } export const handler: Handlers = { GET(req, { render }) { if (req.headers.get("accept")?.includes("text/html")) { return render({ info: "intercepted", }); } else { return new Response("This is plain text"); } }, POST() { return new Response("POST response"); }, };