Skip to content

Commit

Permalink
fix(cli): add check on process.env.HOST
Browse files Browse the repository at this point in the history
`process.env.HOST` may be `undefined` so we need to add a check on it !

Signed-off-by: Atef Ben Ali <[email protected]>
  • Loading branch information
atefBB authored and dhmlau committed Jun 21, 2024
1 parent 7a1083e commit d33ebf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/generators/app/templates/src/index.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (require.main === module) {
const config = {
rest: {
port: +(process.env.PORT ?? 3000),
host: process.env.HOST,
host: process.env.HOST !== undefined ? process.env.HOST : '127.0.0.1',
// The `gracePeriodForClose` provides a graceful close for http/https
// servers with keep-alive clients. The default value is `Infinity`
// (don't force-close). If you want to immediately destroy all sockets
Expand Down

0 comments on commit d33ebf4

Please sign in to comment.