diff --git a/autobahn/serve.ts b/autobahn/serve.ts index 1f3fe79..0857dc9 100644 --- a/autobahn/serve.ts +++ b/autobahn/serve.ts @@ -1,19 +1,14 @@ +// This was done, so it would be easier for me to access the autobahn results via the browser, as I am connecting and +// working on my homelab. const server = Bun.serve({ - async fetch(req) { - const url = new URL(req.url); - const filePath = `./server${url.pathname}`; - - const file = Bun.file(filePath); - const exists = await file.exists(); - if (exists) { - return new Response(file); - } + fetch: async (req) => { + const file = Bun.file(`./server${new URL(req.url).pathname}`); + if (await file.exists()) return new Response(file); return new Response("Not Found", { status: 404 }); }, port: 3000, - hostname: "0.0.0.0", + hostname: "192.168.1.41", }); console.log(`Server running at ${server.url}`); -console.log(`Access from your network at http://192.168.1.41:${server.port}`);