mirror of
https://github.com/comatory/fb2iCal
synced 2025-06-05 22:09:25 +02:00
Do not use HTTPS application routing by default, make it optional via
env variable.
This commit is contained in:
@ -18,11 +18,16 @@ const port = process.env.PORT
|
||||
const certEndpoint = process.env.CERT_ENDPOINT || ''
|
||||
const certSecret = process.env.CERT_SECRET || ''
|
||||
const isDevelopment = process.env.NODE_ENV === 'development'
|
||||
const enforceHTTPS = Boolean(process.env.ENFORCE_HTTPS)
|
||||
|
||||
const app = express()
|
||||
const appLogger = createAppLogger({ dev: isDevelopment })
|
||||
|
||||
app.use(forceSecure)
|
||||
// Force app to always redirect to HTTPS
|
||||
// use when you can't configure web server
|
||||
if (enforceHTTPS) {
|
||||
app.use(forceSecure)
|
||||
}
|
||||
|
||||
// Server logs
|
||||
app.use(createRouteLogger({ dev: isDevelopment }))
|
||||
|
Reference in New Issue
Block a user