1
2
3
4
5
6
7
8
import { myTestForm } from "https://esm.town/v/octref/myTestForm";
// View at https://api.val.town/v1/express/stevekrouse.expressHTMLExample?name=Steve
export async function expressHTMLExample(req: express.Request, res: express.Response) {
myTestForm.push(req.query.name || req.body.name);
return res.send(`<h1>Hi ${req.query.name || req.body.name}!</h1>`);
}
// Forked from @stevekrouse.expressHTMLExample
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.