File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ var help = [
1717 " --config OUTFILE Location of the configuration file for the proxy server" ,
1818 " --silent Silence the log output from the proxy server" ,
1919 " -h, --help You're staring at it"
20- ] ;
20+ ] . join ( '\n' ) ;
2121
2222if ( argv . h || argv . help || Object . keys ( argv ) . length === 2 ) {
23- util . puts ( help . join ( '\n' ) ) ;
23+ util . puts ( help ) ;
2424 process . exit ( 0 ) ;
2525}
2626
@@ -49,7 +49,7 @@ config.silent = typeof argv.silent !== 'undefined' ? argv.silent : config.silent
4949//
5050// If we were passed a target, parse the url string
5151//
52- if ( target ) location = target . split ( ':' ) ;
52+ if ( typeof target === 'string' ) location = target . split ( ':' ) ;
5353
5454//
5555// Create the server with the specified options
@@ -59,9 +59,12 @@ if (location) {
5959 var targetPort = location . length === 1 ? 80 : location [ 1 ] ;
6060 server = httpProxy . createServer ( targetPort , location [ 0 ] , config ) ;
6161}
62- else {
62+ else if ( config . router ) {
6363 server = httpProxy . createServer ( config ) ;
6464}
65+ else {
66+ return util . puts ( help ) ;
67+ }
6568
6669//
6770// Start the server
You can’t perform that action at this time.
0 commit comments