Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
PUBLIC
/
surfer-okd
This project
Loading...
Sign in
Toggle navigation
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
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
1 changed file
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
:
tru
e
folderListingEnabled
:
fals
e
};
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
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment