itch
itch copied to clipboard
Installed browser game not having correctly header applied for brotli header
game: https://3di70r.itch.io/crusty-proto
You may use the following script to serve them:
#!/usr/bin/env bun
Bun.serve({
port: 3000,
async fetch(req) {
const url = new URL(req.url)
const path = url.pathname === "/" ? "/index.html" : url.pathname
return new Response(Bun.file("." + path), {
headers: path.endsWith(".br") ? {
"Content-Encoding": "br",
"Content-Type": path.endsWith(".js.br") ? "application/javascript"
: path.endsWith(".wasm.br") ? "application/wasm"
: "application/octet-stream"
} : undefined
})
},
})
console.log("✅ http://localhost:3000")
Bun.spawn(["cmd", "/c", "start", "http://localhost:3000"])