mirror of
https://github.com/denoland/deno
synced 2024-08-28 20:39:51 +00:00
![Divy Srivastava](/assets/img/avatar_default.png)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl> Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
24 lines
465 B
JavaScript
24 lines
465 B
JavaScript
// 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,
|
|
});
|