Files
sweet/tests/fixture/routes/intercept.tsx
T
Luca Casonato b12867a582 feat: support JSX automatic mode (#610)
This commit adds support for JSX automatic mode instead of the default
mode that requires the presence of the JSX pragma in each file.

This commit also adds the config file to the `fresh.gen.ts` manifest,
which is used to determine if the client emit should use automatic mode.

The minimum Deno version has also been bumped to 1.25.0.
2022-08-26 11:03:00 +02:00

19 lines
414 B
TypeScript

import { HandlerContext } from "$fresh/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");
},
};