Files
bun.sh/test/js/bun/http/server-bigfile-send.fixture.js
2024-09-03 21:32:52 -07:00

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);