mirror of
https://github.com/denoland/deno.git
synced 2024-11-27 16:10:57 -05:00
24 lines
465 B
React
24 lines
465 B
React
|
// Bun uses a custom non-portable react-dom fork.
|
||
|
// TODO(@littledivy): Reenable this when it stops segfaulting.
|
||
|
import { renderToReadableStream } from "./react-dom.js";
|
||
|
const headers = {
|
||
|
headers: {
|
||
|
"Content-Type": "text/html",
|
||
|
},
|
||
|
};
|
||
|
|
||
|
const App = () => (
|
||
|
<html>
|
||
|
<body>
|
||
|
<h1>Hello World</h1>
|
||
|
</body>
|
||
|
</html>
|
||
|
);
|
||
|
|
||
|
Bun.serve({
|
||
|
async fetch(req) {
|
||
|
return new Response(await renderToReadableStream(<App />), headers);
|
||
|
},
|
||
|
port: 9000,
|
||
|
});
|