import { article } from "https://esm.town/v/pomdtr/article";
import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
import { html } from "https://esm.town/v/stevekrouse/html?v=5";
export async function exampleArticle(req: Request) {
const { author, name } = extractValInfo(import.meta.url);
if (new URL(req.url).pathname == "/edit") {
return Response.redirect(`https://val.town/v/${author}/${name}`);
}
return html(await article(author, name));
}