Skip to content

Commit

Permalink
apply hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Sep 10, 2024
1 parent e1fe3f1 commit f7867db
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/explorer/bin/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const argv = yargs(process.argv.slice(2))
default: process.env.PORT || 13690,
},
host: {
alias: "h",
alias: ["H", "hostname"],
description: "Host for the server",
type: "string",
default: process.env.HOST || "0.0.0.0",
Expand All @@ -44,7 +44,7 @@ const argv = yargs(process.argv.slice(2))
default: process.env.WORLDS_FILE || "worlds.json",
},
dev: {
alias: "d",
alias: "D",
description: "Run in development mode",
type: "boolean",
default: false,
Expand All @@ -67,10 +67,10 @@ async function startExplorer() {

if (dev) {
command = "pnpm";
args = ["dev"];
args = ["dev", "--hostname", host];
} else {
command = "pnpm";
args = ["start"];
args = ["start", "--hostname", host];
}

explorerProcess = spawn(command, args, {
Expand All @@ -79,7 +79,6 @@ async function startExplorer() {
env: {
...process.env,
PORT: port.toString(),
HOST: host,
WORLD_ADDRESS: worldAddress?.toString(),
INDEXER_DATABASE: path.join(process.cwd(), indexerDatabase),
},
Expand Down

0 comments on commit f7867db

Please sign in to comment.