aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/http-hello.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-06 14:18:16 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-12-06 14:18:25 -0800
commit31f025fa02c1c206944effe4395c841fc9e6b2fb (patch)
treed77fafd09672e29227fb60b170232cda4f3fc10d /bench/snippets/http-hello.js
parent81317a52ea13b39de22d2cdeff8ecc231224f9e7 (diff)
downloadbun-31f025fa02c1c206944effe4395c841fc9e6b2fb.tar.gz
bun-31f025fa02c1c206944effe4395c841fc9e6b2fb.tar.zst
bun-31f025fa02c1c206944effe4395c841fc9e6b2fb.zip
Add snippet
Diffstat (limited to 'bench/snippets/http-hello.js')
-rw-r--r--bench/snippets/http-hello.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/bench/snippets/http-hello.js b/bench/snippets/http-hello.js
new file mode 100644
index 000000000..f92f303f4
--- /dev/null
+++ b/bench/snippets/http-hello.js
@@ -0,0 +1,7 @@
+var i = 0;
+export default {
+ fetch(req) {
+ if (i++ === 200_000 - 1) queueMicrotask(() => process.exit(0));
+ return new Response("Hello, World!" + i);
+ },
+};