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

Commit 5ed0081

Browse files
author
Haz Æ 41
authored
Allow custom host on aleph dev
1 parent 9ac2d1f commit 5ed0081

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cli/dev.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@ Usage:
99
if the <dir> is empty, the current directory will be used.
1010
1111
Options:
12+
-h, --host A hos 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.h || options.host || 'localhost')
1921
const port = parseInt(String(options.p || options.port || '8080'))
22+
2023
if (isNaN(port) || port <= 0 || !Number.isInteger(port)) {
2124
log.error(`invalid port '${options.port || options.p}'`)
2225
Deno.exit(1)
2326
}
24-
start(appDir, 'localhost', port, true, Boolean(options.r || options.reload))
27+
28+
start(appDir, host, port, true, Boolean(options.r || options.reload))
2529
}

0 commit comments

Comments
 (0)