UNPKG

@ments/web

Version:

A lightweight, type-safe server framework for Bun with automatic performance tracking.

17 lines (15 loc) 367 B
import path from "path"; import { serve } from "../../src/web"; async function* streamIndexPage() { yield `<div style="display: flex; flex-direction: column-reverse; font-size: 24px;">`; while (true) { yield `<span> ${new Date()} </span> `; await Bun.sleep(1000); } } serve((req: Request) => { return streamIndexPage(); });