blob: e721033a29616a9178b3399ed9ea4980f1f0930d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// 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,
});
|