Skip to content

Commit 402ad49

Browse files
committed
Merge branch 'johntron-feature/dotfiles-visibility'
2 parents 4f3a998 + 966ce9c commit 402ad49

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bin/http-server

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ if (argv.h || argv.help) {
3939
' -K --key Path to ssl key file (default: key.pem).',
4040
'',
4141
' -r --robots Respond to /robots.txt [User-agent: *\\nDisallow: /]',
42+
' --no-dotfiles Do not show dotfiles',
4243
' -h --help Print this list and exit.'
4344
].join('\n'));
4445
process.exit();
@@ -101,7 +102,8 @@ function listen(port) {
101102
robots: argv.r || argv.robots,
102103
ext: argv.e || argv.ext,
103104
logFn: logger.request,
104-
proxy: proxy
105+
proxy: proxy,
106+
showDotfiles: argv.dotfiles
105107
};
106108

107109
if (argv.cors) {

lib/http-server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ function HttpServer(options) {
4646
this.cache = options.cache === undefined ? 3600 : options.cache; // in seconds.
4747
this.showDir = options.showDir !== 'false';
4848
this.autoIndex = options.autoIndex !== 'false';
49+
this.showDotfiles = options.showDotfiles;
4950
this.gzip = options.gzip === true;
5051
this.contentType = options.contentType || 'application/octet-stream';
5152

@@ -96,6 +97,7 @@ function HttpServer(options) {
9697
root: this.root,
9798
cache: this.cache,
9899
showDir: this.showDir,
100+
showDotfiles: this.showDotfiles,
99101
autoIndex: this.autoIndex,
100102
defaultExt: this.ext,
101103
gzip: this.gzip,

0 commit comments

Comments
 (0)