add server file
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m27s
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m27s
This commit is contained in:
17
server.ts
Normal file
17
server.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { serve } from "bun";
|
||||
|
||||
serve({
|
||||
port: 3000,
|
||||
fetch(req) {
|
||||
const url = new URL(req.url);
|
||||
let path = url.pathname;
|
||||
|
||||
if (path === "/") path = "/index.html";
|
||||
|
||||
const file = Bun.file(`./build${path}`);
|
||||
|
||||
return new Response(file);
|
||||
},
|
||||
});
|
||||
|
||||
console.log("Frontend listening on :3000");
|
||||
Reference in New Issue
Block a user