diff options
author | 2022-07-04 16:41:16 -0700 | |
---|---|---|
committer | 2022-07-04 16:41:16 -0700 | |
commit | b685cd49a6360f55ad2752c5225fad8fe2ac0f05 (patch) | |
tree | 23fff777f288717a5cbe365d66b5954f8730671c /bench/react-hello-world.jsx | |
parent | 9c960fcafd52d6206c958d3e7791f72c6a059632 (diff) | |
download | bun-b685cd49a6360f55ad2752c5225fad8fe2ac0f05.tar.gz bun-b685cd49a6360f55ad2752c5225fad8fe2ac0f05.tar.zst bun-b685cd49a6360f55ad2752c5225fad8fe2ac0f05.zip |
[bench] Add a react ssr hello world
Diffstat (limited to 'bench/react-hello-world.jsx')
-rw-r--r-- | bench/react-hello-world.jsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bench/react-hello-world.jsx b/bench/react-hello-world.jsx new file mode 100644 index 000000000..6715dd22f --- /dev/null +++ b/bench/react-hello-world.jsx @@ -0,0 +1,19 @@ +// import { renderToReadableStream } from "react-dom/server.browser"; +var { renderToReadableStream } = import.meta.require( + "../test/bun.js/reactdom-bun.js" +); + +const headers = { + headers: { + "Content-Type": "text/html", + }, +}; + +export default { + async fetch(req) { + return new Response( + await renderToReadableStream(<div>Hello World</div>), + headers + ); + }, +}; |