Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

PUBLIC / surfer-okd

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 8a5c7d41 authored 6 years ago by Johannes Zellner's avatar Johannes Zellner
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

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

1 parent e3425579
Hide whitespace changes
Inline Side-by-side
Showing with 2 additions and 2 deletions
  • server.js
server.js
View file @8a5c7d4
......@@ -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) {
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
  • Please register or sign in to post a comment