Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

Render a val readme

Inspired by github pages.

Use https://pomdtr-page.web.val.run/v/<author>/<name>

Example

You can see this val readme at https://pomdtr-page.web.val.run/v/pomdtr/readme

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { article } from "https://esm.town/v/pomdtr/article";
import { html } from "https://esm.town/v/stevekrouse/html?v=5";
export async function readme(request: Request): Promise<Response> {
const url = new URL(request.url);
const [, , author, name] = url.pathname.split("/");
if (!author || !name) {
return new Response(`Wrong format. Please use https://${url.host}/v/<author>/<name>.`, {
status: 405,
});
}
const body = await article(author, name);
return html(body);
}
pomdtr-page.web.val.run
November 16, 2023