aboutsummaryrefslogtreecommitdiff
path: root/bench/react-hello-world.deno.jsx
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-07-04 16:41:16 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-07-04 16:41:16 -0700
commitb685cd49a6360f55ad2752c5225fad8fe2ac0f05 (patch)
tree23fff777f288717a5cbe365d66b5954f8730671c /bench/react-hello-world.deno.jsx
parent9c960fcafd52d6206c958d3e7791f72c6a059632 (diff)
downloadbun-b685cd49a6360f55ad2752c5225fad8fe2ac0f05.tar.gz
bun-b685cd49a6360f55ad2752c5225fad8fe2ac0f05.tar.zst
bun-b685cd49a6360f55ad2752c5225fad8fe2ac0f05.zip
[bench] Add a react ssr hello world
Diffstat (limited to 'bench/react-hello-world.deno.jsx')
-rw-r--r--bench/react-hello-world.deno.jsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/bench/react-hello-world.deno.jsx b/bench/react-hello-world.deno.jsx
new file mode 100644
index 000000000..25c960a80
--- /dev/null
+++ b/bench/react-hello-world.deno.jsx
@@ -0,0 +1,18 @@
+import { renderToReadableStream } from "https://esm.run/react-dom/server";
+import { serve } from "https://deno.land/std@0.146.0/http/server.ts";
+import * as React from "https://esm.run/react";
+const headers = {
+ headers: {
+ "Content-Type": "text/html",
+ },
+};
+
+await serve(
+ async (req) => {
+ return new Response(
+ await renderToReadableStream(<div>Hello World</div>),
+ headers
+ );
+ },
+ { port: 8080 }
+);