1// This val responds with an HTML form to input the user's name and greets them upon form submission
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method === "POST") {
5 const formData = new URLSearchParams(await req.text());
1// This val responds with an HTML form to input the user's name and greets them
2
3export default async function(req: Request): Promise<Response> {
4 const htmlResponse = `
5 <form action="/" method="POST">
1// This val greets the user with their inputted name
2
3export default async function(req: Request): Promise<Response> {
4 const formData = new URLSearchParams(await req.text());
5 const name = formData.get("name") || "stranger";
1// This val responds with an HTML form to input the user's name and greet them
2
3export default async function(req: Request): Promise<Response> {
4 const htmlResponse = `
5 <form action="/" method="POST">
1// This val responds with an HTML greeting of "Hello world"
2
3export default async function(req: Request): Promise<Response> {
4 const htmlResponse = "<h1>Hello world</h1>";
5 return new Response(htmlResponse, {
1// This val will simply respond with "Hello world" to all incoming requests
2
3export default async function(req: Request): Promise<Response> {
4 return new Response("Hello world");
5}
1// This val will respond with a styled HTML form for users to input their name
2
3export default async function (req: Request): Promise<Response> {
4 if (req.method === "POST") {
5 const formData = new URLSearchParams(await req.text());
1// This val will respond with a simple HTML form for users to input their name
2
3export default async function (req: Request): Promise<Response> {
4 if (req.method === "POST") {
5 const formData = new URLSearchParams(await req.text());
1// This val responds with an HTML form for users to input their name and get a greeting
2
3export default async function (req: Request): Promise<Response> {
4 // Reading form data if present
5 const formData = new URLSearchParams(await req.text());
1// This val will respond with an HTML greeting to any HTTP request
2
3export default async function (req: Request): Promise<Response> {
4 return new Response(`
5 <html>
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.