fix(all): Minor changes in PROD.
This commit is contained in:
parent
f69b3f004c
commit
8a04ad2354
1 changed files with 7 additions and 9 deletions
16
src/app.ts
16
src/app.ts
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Reference in a new issue