From a3d557712f39e7899e8353d5bf0bcb6ea6d0e3c0 Mon Sep 17 00:00:00 2001 From: "me@rodrigorodriguez.com" Date: Sat, 19 Oct 2024 13:55:57 -0300 Subject: [PATCH] new(all); ROUTER. --- src/app.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app.ts b/src/app.ts index aadbf981..67b20482 100644 --- a/src/app.ts +++ b/src/app.ts @@ -293,12 +293,14 @@ export class GBServer { await GBSSR.ssrFilter(req, res, next); } } else { + GBLogEx.info(0, `Host request: ${host}`); + // If the domain is in routeConfig, proxy to the corresponding local service if (routeConfig[host]) { const target = `http://localhost:${routeConfig[host]}`; - console.log(`Routing to internal server: ${target}`); + GBLogEx.info(0, `Routing to internal server: ${target}`); return proxy.web(req, res, { target }, (err) => { - console.error('Proxy error:', err); + GBLogEx.error(0, `GBRouter error: ${GBUtil.toYAML(err)}`); res.status(500).send('Internal proxy error.'); }); }