Commit 8a5c7d41 by Johannes Zellner

disable folder listing by default and do not show welcome screen when enabled

1 parent e3425579
Showing with 2 additions and 2 deletions
...@@ -29,7 +29,7 @@ var configFile = path.resolve(__dirname, process.argv[3] || '.config.json'); ...@@ -29,7 +29,7 @@ var configFile = path.resolve(__dirname, process.argv[3] || '.config.json');
mkdirp.sync(rootFolder); mkdirp.sync(rootFolder);
var config = { var config = {
folderListingEnabled: true folderListingEnabled: false
}; };
function getSettings(req, res, next) { function getSettings(req, res, next) {
...@@ -87,7 +87,7 @@ app.use(router); ...@@ -87,7 +87,7 @@ app.use(router);
app.use('/_admin', express.static(__dirname + '/frontend')); app.use('/_admin', express.static(__dirname + '/frontend'));
app.use('/', express.static(rootFolder)); app.use('/', express.static(rootFolder));
app.use('/', function welcomePage(req, res, next) { 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')); res.status(200).sendFile(path.join(__dirname, '/frontend/welcome.html'));
}); });
app.use('/', function (req, res, next) { app.use('/', function (req, res, next) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!