summaryrefslogtreecommitdiff
path: root/cli/bench/http/bun_http_send_file.js
blob: 615c35d31aa212214b97423fbbe24266e2f9f65e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
const port = Bun.argv[2] || "4545";

const path = new URL("../testdata/128k.bin", import.meta.url).pathname;

Bun.serve({
  fetch(_req) {
    const file = Bun.file(path);
    return new Response(file);
  },
  port: Number(port),
});