From 8a5c7d41224e6c232ea6095168f456d1887e112c Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 13 Sep 2018 21:16:44 +0200 Subject: disable folder listing by default and do not show welcome screen when enabled --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 60c1bdd..f661e87 100755 --- a/server.js +++ b/server.js @@ -29,7 +29,7 @@ var configFile = path.resolve(__dirname, process.argv[3] || '.config.json'); mkdirp.sync(rootFolder); var config = { - folderListingEnabled: true + folderListingEnabled: false }; function getSettings(req, res, next) { @@ -87,7 +87,7 @@ app.use(router); app.use('/_admin', express.static(__dirname + '/frontend')); app.use('/', express.static(rootFolder)); app.use('/', function welcomePage(req, res, next) { - if (req.path !== '/') return next(); + if (config.folderListingEnabled || req.path !== '/') return next(); res.status(200).sendFile(path.join(__dirname, '/frontend/welcome.html')); }); app.use('/', function (req, res, next) { -- cgit v1.2.3