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);
}