export default async function(req: Request): Promise<Response> {
const url = new URL(req.url);
const search = url.searchParams;
const name = search.get("name") || "anonymous";
return new Response(
`
<html>
<body>
<h1>Hello, ${name}!</h1>
<a href="${import.meta.url.replace("esm.town", "val.town")}">View Source</a>
</body>
</html>
`,
{ headers: { "Content-Type": "text/html" } },
);
}