From 8d45f992ccba4f4f1e4e636a030223ab23c77162 Mon Sep 17 00:00:00 2001 From: Aroop Roelofs Date: Mon, 31 Jul 2023 02:02:31 +0200 Subject: [PATCH] Do not use new for router --- webserver/webserver.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webserver/webserver.ts b/webserver/webserver.ts index 5060686f..7132964b 100644 --- a/webserver/webserver.ts +++ b/webserver/webserver.ts @@ -4,7 +4,6 @@ import { StatusCodes } from "./http/status-codes.ts"; export class Webserver { private server: any = null; - private router: Router = new Router(); constructor( private readonly port: number = 80 @@ -31,7 +30,7 @@ export class Webserver { Logger.debug(`Request from "${(conn.remoteAddr as Deno.NetAddr).hostname!}:${(conn.remoteAddr as Deno.NetAddr).port!}": ${request.request.method} | ${request.request.url}`); try { // Run the required route - const response: Response = await this.router.execute(request.request); + const response: Response = await Router.execute(request.request); // Send our response await request.respondWith(response);