feat: massive front-end overhaul and initial github release
This commit is contained in:
parent
a2b40e38bf
commit
d5a0e70580
303 changed files with 19840 additions and 676 deletions
22
src/bun/server.ts
Normal file
22
src/bun/server.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { SERVER_PORT } from "../shared/constants";
|
||||
import path from 'node:path';
|
||||
import { host } from "./utils";
|
||||
|
||||
export function RunBunServer ()
|
||||
{
|
||||
console.log("Launching Server on port ", SERVER_PORT);
|
||||
return Bun.serve({
|
||||
port: SERVER_PORT,
|
||||
hostname: host,
|
||||
routes: {
|
||||
"/": Bun.file("./dist/index.html"),
|
||||
// Serve a file by lazily loading it into memory
|
||||
"/favicon.ico": Bun.file("./dist/favicon.ico"),
|
||||
},
|
||||
fetch: async (req) =>
|
||||
{
|
||||
const url = new URL(req.url);
|
||||
return new Response(Bun.file(`./${path.join('dist', url.pathname)}`));
|
||||
},
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue