HTML templating and streaming response library for Worker Runtimes such as Cloudflare Workers.
js
function handleRequest(event: FetchEvent) {
return new HTMLResponse(pageLayout('Hello World!', html`
<h1>Hello World!</h1>
${async () => {
const timeStamp = new Date(
await fetch('https://time.api/now').then(r => r.text())
);
return html`<p>The current time is ${timeEl(timeStamp)}.</p>`
}}
`));
}