Skip to content

Commit

Permalink
new(all);
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Oct 20, 2024
1 parent bd26fdc commit 8fe977b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,14 @@ 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}` });

} else if (host === process.env.ROUTER_2) {
GBLogEx.info(0, `Redirecting...`);
return proxy.web(req, res, { target: `http://localhost:${process.env.ROUTER_2_PORT}` });
} else {
await GBSSR.ssrFilter(req, res, next);
Expand Down

0 comments on commit 8fe977b

Please sign in to comment.