Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 6428577

Browse files
Adding the documention for the --host flag and also making it possible to change the hostname.
1 parent 6c15d87 commit 6428577

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cli/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ export default async function (appDir: string, options: Record<string, string |
2121
log.error(`invalid port '${options.port || options.p}'`)
2222
Deno.exit(1)
2323
}
24-
start(appDir, port, true, Boolean(options.r || options.reload))
24+
start(appDir, 'localhost', port, true, Boolean(options.r || options.reload))
2525
}

cli/start.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Usage:
88
if the <dir> is empty, the current directory will be used.
99
1010
Options:
11+
--host The address at which the server is to be started.
1112
-p, --port A port number to start the aleph.js app, default is 8080
1213
-L, --log-level Set log level [possible values: debug, info]
1314
-r, --reload Reload source code cache
@@ -16,10 +17,11 @@ Options:
1617

1718
export default async function (appDir: string, options: Record<string, string | boolean>) {
1819
const { start } = await import('../server.ts')
20+
const host = String(options.h || options.host || 'localhost')
1921
const port = parseInt(String(options.p || options.port || '8080'))
2022
if (isNaN(port) || port <= 0 || !Number.isInteger(port)) {
2123
log.error(`invalid port '${options.port || options.p}'`)
2224
Deno.exit(1)
2325
}
24-
start(appDir, port, false, Boolean(options.r || options.reload))
26+
start(appDir, host, port, false, Boolean(options.r || options.reload))
2527
}

0 commit comments

Comments
 (0)