Skip to content

Commit

Permalink
fix: port
Browse files Browse the repository at this point in the history
  • Loading branch information
denchiklut committed Oct 15, 2024
1 parent c59091d commit 9eb2373
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"plugins": [
["@babel/plugin-proposal-decorators", { "version": "legacy" }],
["babel-plugin-react-compiler", { "target": "19" }],
["babel-plugin-react-compiler", { "target": "19" }],
"@babel/plugin-transform-runtime"
]
}
Expand Down
5 changes: 3 additions & 2 deletions src/server/utils/bootstrap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ export const bootstrap = (server: Express) => {
const protocol = sslIsExist ? 'https' : 'http'
const url = joinPath(`${protocol}://${host}`, pathname)
const message = `Application is started on 🌎 ${url}`
const resolvedPort = port || 3000

if (sslIsExist) {
const key = readFileSync(sslKeyPath)
const cert = readFileSync(sslCertPath)

https.createServer({ key, cert }, server).listen(port, () => logger.info(message))
https.createServer({ key, cert }, server).listen(resolvedPort, () => logger.info(message))
} else {
http.createServer(server).listen(port, () => logger.info(message))
http.createServer(server).listen(resolvedPort, () => logger.info(message))
}
}

0 comments on commit 9eb2373

Please sign in to comment.