Skip to content

Commit ca4aee6

Browse files
Scottindexzero
Scott
authored andcommitted
add optional path argument for specific browser
1 parent 991c68a commit ca4aee6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/http-server

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if (argv.h || argv.help) {
2020
" -e --ext Default file extension if none supplied [none]",
2121
" -s --silent Suppress log messages from output",
2222
" --cors Enable CORS via the 'Access-Control-Allow-Origin' header",
23-
" -o Open browser window after staring the server",
23+
" -o [path] Open browser window after starting the server",
2424
" -c Cache time (max-age) in seconds [3600], e.g. -c10 for 10 seconds.",
2525
" To disable caching, use -c-1.",
2626
"",
@@ -102,7 +102,10 @@ function listen(port) {
102102

103103
log('Hit CTRL-C to stop the server');
104104
if (argv.o) {
105-
opener(protocol + '//' + canonicalHost + ':' + port);
105+
opener(
106+
protocol + '//' + canonicalHost + ':' + port,
107+
{ command: argv.o !== true ? argv.o : null }
108+
);
106109
}
107110
});
108111
}

0 commit comments

Comments
 (0)