From 8568f62bdc6e0bc3626993d8a3efd9758edb291a Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Wed, 17 Apr 2024 12:39:50 -0300 Subject: [PATCH] new(core.gbapp): New API endpoint. --- src/app.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app.ts b/src/app.ts index 412a6b5d..ab995e58 100644 --- a/src/app.ts +++ b/src/app.ts @@ -312,9 +312,11 @@ export class GBServer { })(); }; - // Setups unsecure http redirect. - - if (process.env.NODE_ENV === 'production') { + + if (process.env.CERTIFICATE_PFX) { + + // Setups unsecure http redirect. + const server1 = http.createServer((req, res) => { const host = req.headers.host.startsWith('www.') ? req.headers.host.substring(4) : req.headers.host; @@ -323,9 +325,6 @@ export class GBServer { }).end(); }); server1.listen(80); - } - - if (process.env.CERTIFICATE_PFX) { const options1 = { passphrase: process.env.CERTIFICATE_PASSPHRASE,