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
// This val greets the user with their inputted name
export default async function(req: Request): Promise<Response> {
const formData = new URLSearchParams(await req.text());
const name = formData.get("name") || "stranger";
const htmlResponse = `<h1>Hello, ${name}!</h1>`;
return new Response(htmlResponse, {
headers: { "Content-Type": "text/html" },
});
}
janpaul123-valle_tmp_52909322274216213030085201031243.web.val.run
July 15, 2024