From ebe153287375fa2ea176f3ceecafeb248a5467ee Mon Sep 17 00:00:00 2001 From: Alan Bridgeman Date: Wed, 30 Apr 2025 22:02:59 -0500 Subject: [PATCH] Reordered how things are setup in the Intializer so that static files get treated properly --- src/Initializer.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Initializer.ts b/src/Initializer.ts index e8d6a22..b2f2284 100644 --- a/src/Initializer.ts +++ b/src/Initializer.ts @@ -98,15 +98,6 @@ export class Initializer { // Setup global middleware await this.setupMiddleware(app); - // Setup the router (how the app handles requests) - if(typeof this.controllersPath !== 'undefined') { - this.router = new Router(this.controllersPath); - } - else { - this.router = new Router(); - } - await this.router.setup(app); - // Setup the static file resolver (how the app serves static files) if(typeof this.staticFilesPath !== 'undefined') { await (new StaticFileResolver(this.staticFilesPath)).setup(app); @@ -127,5 +118,14 @@ export class Initializer { else { await (new Renderer()).setup(app); } + + // Setup the router (how the app handles requests) + if(typeof this.controllersPath !== 'undefined') { + this.router = new Router(this.controllersPath); + } + else { + this.router = new Router(); + } + await this.router.setup(app); } } \ No newline at end of file