File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 19
19
20
20
// Defaults
21
21
options . port = options . port || options . p || 8080 ;
22
+ options . directory = options . directory || options . D || '.' ;
22
23
[ 'include' , 'exclude' , 'i' , 'x' ] . forEach ( function ( opt ) {
23
24
options [ opt ] = options [ opt ] || [ ] ;
24
25
// Make sure includes/excludes always end up as arrays
36
37
console . log ( " --port, -p <number> Specify port." ) ;
37
38
console . log ( " --include, -i <bundle> Include the specified bundle." ) ;
38
39
console . log ( " --exclude, -x <bundle> Exclude the specified bundle." ) ;
40
+ console . log ( " --directory, -D <bundle> Serve files from specified directory." ) ;
39
41
console . log ( "" ) ;
40
42
process . exit ( 0 ) ;
41
43
}
71
73
} ) ;
72
74
73
75
// Expose everything else as static files
74
- app . use ( express [ 'static' ] ( '.' ) ) ;
76
+ app . use ( express [ 'static' ] ( options . directory ) ) ;
75
77
76
78
// Finally, open the HTTP server
77
79
app . listen ( options . port ) ;
You can’t perform that action at this time.
0 commit comments