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

Commit 660c558

Browse files
authored
Merge pull request #103 from hazae41/patch-1
Allow custom host on aleph dev
2 parents 9ac2d1f + 5cc15c2 commit 660c558

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/dev.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ Usage:
99
if the <dir> is empty, the current directory will be used.
1010
1111
Options:
12+
-hn, --host A host to start the Aleph.js app, default is localhost
1213
-p, --port A port number to start the Aleph.js app, default is 8080
1314
-L, --log-level Set log level [possible values: debug, info]
1415
-r, --reload Reload source code cache
1516
-h, --help Prints help message
1617
`
1718

1819
export default async function (appDir: string, options: Record<string, string | boolean>) {
20+
const host = String(options.hn || 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, 'localhost', port, true, Boolean(options.r || options.reload))
26+
start(appDir, host, port, true, Boolean(options.r || options.reload))
2527
}

0 commit comments

Comments
 (0)