summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app.js b/app.js
index 4184d74..00fabf1 100644
--- a/app.js
+++ b/app.js
@@ -9,7 +9,8 @@ var config = require('./server/js/config');
// handling variables
const app = express();
const configPath = config.defaultConfigPath;
-const PORT = module.exports.PORT = process.env.PORT || 3000;
+config.loadConfig(configPath);
+const PORT = module.exports.PORT = config.loadedConfig.settings.port || process.env.PORT || 3000;
// loading configurations
app.use(express.static(path.join(__dirname, '/public')));
@@ -18,19 +19,19 @@ app.use(bodyParser.urlencoded({extended: true}));
// set the view engine to ejs
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, '/views'));
-config.loadConfig(configPath);
// routes management
const home = require("./routes/home");
const info = require("./routes/info");
const search = require("./routes/search");
const visit = require("./routes/visit");
-const settings = require("./routes/settings");
+const {save, settings} = require("./routes/settings");
app.get('/', home);
app.get('/info', info);
app.get('/visit', visit);
app.get('/settings', settings);
+app.post('/settings', save);
app.post('/search', search);
// app start