Files
sweet/tests/fixture/routes/intercept.tsx
T
Luca Casonato 80598d07fd feat: use import maps instead of deps files (#209)
This commit updates fresh to use import maps instead of deps files in generated projects.
2022-05-23 19:35:15 +02:00

22 lines
470 B
TypeScript

/** @jsx h */
import { h } from "$fresh/runtime.ts";
import { HandlerContext } from "../../../server.ts";
export default function Page() {
return <div>This is HTML</div>;
}
export const handler = {
GET(req: Request, { render }: HandlerContext) {
if (req.headers.get("accept")?.includes("text/html")) {
return render();
} else {
return new Response("This is plain text");
}
},
POST() {
return new Response("POST response");
},
};