Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { savePageEntryDb } from "https://esm.town/v/rwev/pageEntriesDb";
import { blob } from "https://esm.town/v/std/blob?v=11";
import { email } from "https://esm.town/v/std/email?v=11";
export async function handleSavePageForm(req: Request) {
const formData = await req.formData();
const text = formData.get("text");
const latestVersionId = await savePageEntryDb(text);
return Response.redirect("https://rwev-page.web.val.run/");
// return new Response(`Text updated to version ${latestVersionId}`, {
// headers: {
// "Content-Type": "text/plain",
// },
// });
}
rwev-handlesavepageform.web.val.run
March 23, 2024