X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server.js;h=f661e873ed0e718f726496a2633dccdadf90c356;hb=08c34b2041211e4e29db6027963bfedbcf48af07;hp=60c1bddcd0598f95722c5bed3794e009f9d65c3a;hpb=f43b3c162f5a0857d9fd56f4d8005763fcdca4cc;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git 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) {