From 2cc6a63121eaad75f313a2274a768ff4662de07e Mon Sep 17 00:00:00 2001 From: "me@rodrigorodriguez.com" Date: Mon, 28 Oct 2024 10:11:49 -0300 Subject: [PATCH] fix(all): Back router. --- src/app.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app.ts b/src/app.ts index 6b302d26..d0daea0a 100644 --- a/src/app.ts +++ b/src/app.ts @@ -283,17 +283,15 @@ export class GBServer { } else { // Setups unsecure http redirect. const proxy = httpProxy.createProxyServer({}); + GBLogEx.verbose(0, `Redirecting... ${req.originalUrl}`); if (host === process.env.API_HOST) { - GBLogEx.info(0, `Redirecting to API...`); return proxy.web(req, res, { target: 'http://localhost:1111' }); // Express server } else if (host === process.env.ROUTER_1) { - GBLogEx.info(0, `Redirecting...`); - return proxy.web(req, res, { target: `http://localhost:${process.env.ROUTER_1_PORT}` }); // Express server + return proxy.web(req, res, { target: `http://localhost:${process.env.ROUTER_1_PORT}` }); } else if (host === process.env.ROUTER_2) { - GBLogEx.info(0, `Redirecting...`); - return proxy.web(req, res, { target: `http://localhost:${process.env.ROUTER_2_PORT}` }); // Express server + return proxy.web(req, res, { target: `http://localhost:${process.env.ROUTER_2_PORT}` }); } else { await GBSSR.ssrFilter(req, res, next); }