Public
Back
Version 11
11/2/2023
import { httpRegex } from "https://esm.town/v/stevekrouse/httpRegex";
export function lookup(req) {
try {
let url = new URL(req.url);
const [, handle, name] = url.pathname.match(httpRegex);
} catch(e) {
return new Response("Could not parse val name from web val URL")
}
return Response.redirect(`https://val.town/v/${handle}/${name}`);
}
stevekrouse-lookup.web.val.run
Updated: November 2, 2023