Public
HTTP (deprecated)
version 12
Readme

used in https://www.val.town/v/substrate/websim

import urlHeader from "https://esm.town/v/substrate/urlHeader"; export default async function(req: Request): Promise<Response> { const searchParams = new URL(req.url).searchParams; const { url = "foo" } = Object.fromEntries(searchParams); const html = ` ${urlHeader(url)} <div>content</div> `; return new Response(html, { headers: { "Content-Type": "text/html", }, }); }
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
substrate-urlheader.web.val.run
July 11, 2024