import { PageSection } from "$fresh/www/components/PageSection.tsx"; import { SideBySide } from "$fresh/www/components/SideBySide.tsx"; import { CodeWindow } from "$fresh/www/components/CodeWindow.tsx"; import { CodeBlock } from "$fresh/www/components/CodeBlock.tsx"; import { SectionHeading } from "$fresh/www/components/homepage/SectionHeading.tsx"; import { DemoBox } from "$fresh/www/components/homepage/DemoBox.tsx"; import { ExampleArrow } from "$fresh/www/components/homepage/ExampleArrow.tsx"; import { FancyLink } from "$fresh/www/components/FancyLink.tsx"; const routingCode = `import { Handlers } from "$fresh/server.ts"; export const handler: Handlers = { async POST(req, ctx) { const form = await req.formData(); const email = form.get("email")?.toString(); // Save email to database here // Redirect user to thank you page. const headers = new Headers(); headers.set("location", "/thanks-for-subscribing"); return new Response(null, { status: 303, headers, }); }, };`; export function FormsSection() { return (
Forms, the right way

Don't fight the browser. Fresh helps you handle form submissions and other dynamic requests server-side, simply and easily.

Since Fresh is built on{" "} Deno, it's built on web standards.

Forms in Fresh
{ /*

TODO: something goes here.

*/ }
); }