File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ var help = [
17
17
" --config OUTFILE Location of the configuration file for the proxy server" ,
18
18
" --silent Silence the log output from the proxy server" ,
19
19
" -h, --help You're staring at it"
20
- ] ;
20
+ ] . join ( '\n' ) ;
21
21
22
22
if ( argv . h || argv . help || Object . keys ( argv ) . length === 2 ) {
23
- util . puts ( help . join ( '\n' ) ) ;
23
+ util . puts ( help ) ;
24
24
process . exit ( 0 ) ;
25
25
}
26
26
@@ -49,7 +49,7 @@ config.silent = typeof argv.silent !== 'undefined' ? argv.silent : config.silent
49
49
//
50
50
// If we were passed a target, parse the url string
51
51
//
52
- if ( target ) location = target . split ( ':' ) ;
52
+ if ( typeof target === 'string' ) location = target . split ( ':' ) ;
53
53
54
54
//
55
55
// Create the server with the specified options
@@ -59,9 +59,12 @@ if (location) {
59
59
var targetPort = location . length === 1 ? 80 : location [ 1 ] ;
60
60
server = httpProxy . createServer ( targetPort , location [ 0 ] , config ) ;
61
61
}
62
- else {
62
+ else if ( config . router ) {
63
63
server = httpProxy . createServer ( config ) ;
64
64
}
65
+ else {
66
+ return util . puts ( help ) ;
67
+ }
65
68
66
69
//
67
70
// Start the server
You can’t perform that action at this time.
0 commit comments