fix: do not set default host to localhost (#9957)
Fixes bug introduced by https://github.com/medusajs/medusa/pull/9912 By default the Node.js server listens on the `0.0.0.0` host. However, the related PR changes the host to `localhost` and hence resulted in an unwanted breaking change. This PR reverts the default value assignment and let Node.js decide the host when not explicitly specified.
This commit is contained in:
@@ -18,8 +18,7 @@ const handlerP =
|
||||
}
|
||||
|
||||
function buildLocalCommands(cli, isLocalProject) {
|
||||
const defaultHost = `localhost`
|
||||
const defaultPort = `9000`
|
||||
const defaultPort = "9000"
|
||||
const directory = path.resolve(`.`)
|
||||
|
||||
const projectInfo = { directory }
|
||||
@@ -290,10 +289,10 @@ function buildLocalCommands(cli, isLocalProject) {
|
||||
.option(`H`, {
|
||||
alias: `host`,
|
||||
type: `string`,
|
||||
default: process.env.HOST || defaultHost,
|
||||
default: process.env.HOST,
|
||||
describe: process.env.HOST
|
||||
? `Set host. Defaults to ${process.env.HOST} (set by env.HOST) (otherwise defaults ${defaultHost})`
|
||||
: `Set host. Defaults to ${defaultHost}`,
|
||||
? `Set host. Defaults to ${process.env.HOST} (set by env.HOST)`
|
||||
: "",
|
||||
})
|
||||
.option(`p`, {
|
||||
alias: `port`,
|
||||
@@ -328,10 +327,10 @@ function buildLocalCommands(cli, isLocalProject) {
|
||||
.option(`H`, {
|
||||
alias: `host`,
|
||||
type: `string`,
|
||||
default: process.env.HOST || defaultHost,
|
||||
default: process.env.HOST,
|
||||
describe: process.env.HOST
|
||||
? `Set host. Defaults to ${process.env.HOST} (set by env.HOST) (otherwise defaults ${defaultHost})`
|
||||
: `Set host. Defaults to ${defaultHost}`,
|
||||
? `Set host. Defaults to ${process.env.HOST} (set by env.HOST)`
|
||||
: ``,
|
||||
})
|
||||
.option(`p`, {
|
||||
alias: `port`,
|
||||
|
||||
Reference in New Issue
Block a user