From 17eff4e73954a7327102feac05c00dde11d3a375 Mon Sep 17 00:00:00 2001 From: Hydroxycarbamide Date: Wed, 3 Jan 2024 10:46:44 +0100 Subject: [PATCH] Set port to 80 and add hello-world --- index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index b57b7a0..6196168 100644 --- a/index.ts +++ b/index.ts @@ -1,9 +1,11 @@ +console.log("Hello World!"); + const fetch = (req: Request) => { const url = new URL(req.url); const path = url.pathname; - if (path === "/") { - return new Response(Bun.file("./index.html"), { + if (path === "/") { + return new Response(Bun.file("./index.html"), { headers: { "Content-Type": "text/html" } @@ -39,7 +41,7 @@ const fetch = (req: Request) => { } Bun.serve({ - port: 8888, + port: 80, hostname: "localhost", fetch });