mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
14 lines
345 B
JavaScript
14 lines
345 B
JavaScript
import { file, serve } from "bun";
|
|
import { join } from "node:path";
|
|
const bigfile = join(import.meta.dir, "../../web/encoding/utf8-encoding-fixture.bin");
|
|
const server = serve({
|
|
port: 0,
|
|
async fetch() {
|
|
return new Response(file(bigfile), {
|
|
headers: { "Content-Type": "text/html" },
|
|
});
|
|
},
|
|
});
|
|
|
|
console.log(server.url.href);
|