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
// @title My Val Town Wish List
import { api } from "https://esm.town/v/pomdtr/api";
import { extractMetadata } from "https://esm.town/v/pomdtr/extractMetadata";
import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
import { gfm } from "https://esm.town/v/pomdtr/gfm";
import { html } from "https://esm.town/v/stevekrouse/html?v=5";
export async function examplePost(req: Request) {
const { author, name } = extractValInfo(import.meta.url);
const { code, readme } = await api(`/v1/alias/${author}/${name}`);
const title = extractMetadata("title", code);
return html(await gfm(readme, { title, favicon: "๐" }));
}