Skip to content

Commit

Permalink
fix(all): Minor changes in PROD.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Jul 9, 2023
1 parent f69b3f0 commit 8a04ad2
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,14 @@ export class GBServer {

// Setups unsecure http redirect.

const httpServer = express();
httpServer.use( (request, response, next) => {
if (request.headers.host != 'localhost' && !request.secure) {
return response.redirect("https://" + request.headers.host + request.url);
}
next();
});
const httpDefaultPort = 80;
httpServer.listen(httpDefaultPort);
const server1 = http.createServer((req,res)=>{

res.writeHead(301, {
Location: "https://" + req.headers.host + req.url
}).end();
});

server1.listen(80);

if (process.env.CERTIFICATE_PFX) {
const options1 = {
Expand Down

0 comments on commit 8a04ad2

Please sign in to comment.