Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 46 additions & 25 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions www/components/homepage/FormsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@ import { ExampleArrow } from "../homepage/ExampleArrow.tsx";
import { FancyLink } from "../FancyLink.tsx";
import { FormSubmitDemo } from "../../islands/FormSubmitDemo.tsx";

const routingCode = `import { Handlers } from "$fresh/server.ts";
const routingCode = `import { define } from "../utils.ts";

export const handler: Handlers = {
async POST(req) {
const form = await req.formData();
export const handler = define.handlers({
async POST(ctx) {
const form = await ctx.req.formData();

// Do something with the form data here,
// then redirect user to thank you page

const headers = new Headers();
headers.set("location", "/thanks");
return new Response(null, {
status: 303,
headers,
headers: { location: "/thanks" },
});
},
};`;
});`;

export function FormsSection() {
return (
Expand Down
2 changes: 1 addition & 1 deletion www/components/homepage/PartialsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ExampleArrow } from "../../components/homepage/ExampleArrow.tsx";
import { RecipeDemo } from "../../components/homepage/RecipeDemo.tsx";
import { FancyLink } from "../../components/FancyLink.tsx";

const islandCode = `import { Partial } from "$fresh/runtime.ts";
const islandCode = `import { Partial } from "fresh/runtime";

export const Recipes = () => (
<div f-client-nav>
Expand Down
Loading