Bun.serve()
from Bun.js
Bun.serve()
https://bun.sh/docs/api/http
λ bun initでreactを選んだらノリがわかる
コレで起動するの意味わからなくて良い
code:server.ts
import index from "./index.html";
const server = Bun.serve({
port: 3000,
routes: {
"/*": index,
},
})
console.log(Listening on http://localhost:${server.port})
code:index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>title</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="./index.ts"></script>
</body>
</html>
index.tsにはReactなり何なりを書く
srcには.tsを指定してる