aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2018-05-17 16:02:00 +0200
committerJohannes Zellner <johannes@cloudron.io>2018-05-17 16:02:00 +0200
commitf43b3c162f5a0857d9fd56f4d8005763fcdca4cc (patch)
treec3951b0cfe5e584bb207545926e4c67cf78dbcfa
parent552d44bbd28eb66c05b450f112ce20bff463fe6f (diff)
downloadSurfer-f43b3c162f5a0857d9fd56f4d8005763fcdca4cc.tar.gz
Surfer-f43b3c162f5a0857d9fd56f4d8005763fcdca4cc.tar.zst
Surfer-f43b3c162f5a0857d9fd56f4d8005763fcdca4cc.zip
Fixup the config file usage
-rw-r--r--frontend/js/app.js14
-rwxr-xr-xserver.js2
2 files changed, 8 insertions, 8 deletions
diff --git a/frontend/js/app.js b/frontend/js/app.js
index e9d469b..6303a89 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -35,7 +35,13 @@ function getProfile(accessToken, callback) {
35 app.session.username = result.body.username; 35 app.session.username = result.body.username;
36 app.session.valid = true; 36 app.session.valid = true;
37 37
38 callback(); 38 superagent.get('/api/settings').query({ access_token: localStorage.accessToken }).end(function (error, result) {
39 if (error) console.error(error);
40
41 app.folderListingEnabled = !!result.body.folderListingEnabled;
42
43 callback();
44 });
39 }); 45 });
40} 46}
41 47
@@ -339,12 +345,6 @@ getProfile(localStorage.accessToken, function (error) {
339 if (error) return console.error(error); 345 if (error) return console.error(error);
340 346
341 loadDirectory(window.location.hash.slice(1)); 347 loadDirectory(window.location.hash.slice(1));
342
343 superagent.get('/api/settings').query({ access_token: localStorage.accessToken }).end(function (error, result) {
344 if (error) console.error(error);
345
346 app.folderListingEnabled = !!result.body.folderListingEnabled;
347 });
348}); 348});
349 349
350$(window).on('hashchange', function () { 350$(window).on('hashchange', function () {
diff --git a/server.js b/server.js
index 4a8bfe5..60c1bdd 100755
--- a/server.js
+++ b/server.js
@@ -23,7 +23,7 @@ var express = require('express'),
23 23
24 24
25var rootFolder = path.resolve(__dirname, process.argv[2] || 'files'); 25var rootFolder = path.resolve(__dirname, process.argv[2] || 'files');
26var configFile = path.resolve(__dirname, process.argv[3] || './config.json'); 26var configFile = path.resolve(__dirname, process.argv[3] || '.config.json');
27 27
28// Ensure the root folder exists 28// Ensure the root folder exists
29mkdirp.sync(rootFolder); 29mkdirp.sync(rootFolder);