From 90b16eef5319ed80ddaba9922d44fdfa388e077c Mon Sep 17 00:00:00 2001 From: garrettmills Date: Tue, 7 Jun 2022 21:56:56 -0500 Subject: [PATCH] Add better debugging to routing service --- src/service/Routing.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/service/Routing.ts b/src/service/Routing.ts index 26e1f42..e5165ea 100644 --- a/src/service/Routing.ts +++ b/src/service/Routing.ts @@ -11,6 +11,7 @@ import {Config} from './Config' import {PackageDiscovered} from '../support/PackageDiscovered' import {staticServer} from '../http/servers/static' import {Bus} from '../support/bus' +import {RequestLocalStorage} from '../http/RequestLocalStorage' /** * Application unit that loads the various route files from `app/http/routes` and pre-compiles the route handlers. @@ -26,6 +27,9 @@ export class Routing extends Unit { @Inject() protected readonly bus!: Bus + @Inject() + protected readonly request!: RequestLocalStorage + protected compiledRoutes: Collection> = new Collection>() public async up(): Promise { @@ -164,6 +168,11 @@ export class Routing extends Unit { } public getAppUrl(): UniversalPath { + if ( this.request.has() ) { + const request = this.request.get() + this.logging.debug(`url: ${request.url} | fullUrl: ${request.fullUrl}`) + } + const rawHost = String(this.config.get('server.url', 'http://localhost')).toLowerCase() const isSSL = rawHost.startsWith('https://') const port = this.config.get('server.port', 8000)