Skip to content

Commit

Permalink
Merge branch 'main' into modules-in-realms
Browse files Browse the repository at this point in the history
  • Loading branch information
andreubotella authored Sep 4, 2022
2 parents 934106c + 50fc5d1 commit bae389b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cli/bench/http/bun_hono_router.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ const port = Bun.argv[2] || "4545";
const { Hono } = require("../testdata/npm/hono/dist/index.js");

const app = new Hono();
app.use("*", async (c, n) => {
c.res.headers.set("Date", (new Date()).toUTCString());
await n();
});
app.get("/", (c) => c.text("Hello, World!"));

Bun.serve({
Expand Down
4 changes: 3 additions & 1 deletion cli/bench/http/bun_http.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
const port = Bun.argv[2] || "4545";
Bun.serve({
fetch(_req) {
return new Response("Hello World");
return new Response("Hello World", {
headers: { "Date": (new Date()).toUTCString() },
});
},
port: Number(port),
});
4 changes: 3 additions & 1 deletion cli/bench/http/bun_http_send_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const path = new URL("../testdata/128k.bin", import.meta.url).pathname;
Bun.serve({
fetch(_req) {
const file = Bun.file(path);
return new Response(file);
return new Response(file, {
headers: { "Date": (new Date()).toUTCString() },
});
},
port: Number(port),
});

0 comments on commit bae389b

Please sign in to comment.