Skip to content

Commit

Permalink
fix: https log
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Nov 18, 2021
1 parent 11099eb commit af8009a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ export async function startServer(host: string, port: number | string) {
// as the really first thing setup loggers so all logs will go to file if specified in settings
setupLogging(settings)

if (process.env.HTTPS || settings?.gateway?.https) {
const httpsEnabled = process.env.HTTPS || settings?.gateway?.https

if (httpsEnabled) {
logger.info('HTTPS is enabled. Loading cert and keys')
const { cert, key } = await loadCertKey()
server = createHttpsServer(
Expand All @@ -159,7 +161,7 @@ export async function startServer(host: string, port: number | string) {
typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port
logger.info(
`Listening on ${bind} host ${host} protocol ${
process.env.HTTPS ? 'HTTPS' : 'HTTP'
httpsEnabled ? 'HTTPS' : 'HTTP'
}`
)
})
Expand Down

0 comments on commit af8009a

Please sign in to comment.