fix: use Bun.serve() for proper HTMLBundle handling
- Switch to explicit Bun.serve() call - Add route handler for static files since 'static' prop not in types yet 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a83f4ece7a
commit
746528f6ab
|
|
@ -1,12 +1,20 @@
|
||||||
#!/usr/bin/env bun
|
#!/usr/bin/env bun
|
||||||
import index from "./index.html"
|
import index from "./index.html"
|
||||||
|
|
||||||
export default {
|
Bun.serve({
|
||||||
port: 3000,
|
port: 3000,
|
||||||
routes: {
|
routes: {
|
||||||
"/": index,
|
"/": index,
|
||||||
},
|
"/public/*": async (req) => {
|
||||||
static: {
|
const path = new URL(req.url).pathname.replace("/public/", "")
|
||||||
"/public": "./public",
|
const file = Bun.file(`./public/${path}`)
|
||||||
},
|
if (await file.exists()) {
|
||||||
|
return new Response(file)
|
||||||
}
|
}
|
||||||
|
return new Response("Not found", { status: 404 })
|
||||||
|
},
|
||||||
|
},
|
||||||
|
development: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log("Dev server running at http://localhost:3000")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user