From 469a83c8e764c69bda0fcb56141acf332badad04 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Wed, 10 May 2023 15:00:17 +0200 Subject: [PATCH] add listening info on start --- http_server.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/http_server.ts b/http_server.ts index fd0cce1..39894bc 100644 --- a/http_server.ts +++ b/http_server.ts @@ -30,6 +30,12 @@ export class HTTPServer { hostname: options.host, }); + console.log( + `Listening on ${ + options.host ? options.host : "http://localhost" + }:${options.port} !`, + ); + if (options.staticLocalDir && options.staticServePath) { this.staticLocalDir = options.staticLocalDir; this.staticServePath = options.staticServePath; @@ -42,14 +48,12 @@ export class HTTPServer { const filepath = decodeURIComponent(url.pathname); if (this.staticServePath && filepath.startsWith(this.staticServePath)) { - console.log(filepath, this.staticServePath); const fileDir = filepath.split("/").slice(2).join("/"); const pathLoc = path.join( Deno.cwd(), this.staticLocalDir as string, fileDir, ); - console.log(pathLoc); let file; try { file = await Deno.open(pathLoc, { read: true });