Merged main & websocket server, refactored libs, image uploads fixes

This commit is contained in:
NGPixel
2016-10-16 01:34:34 -04:00
parent 6ea243e8d4
commit 91d524eb06
29 changed files with 350 additions and 3985 deletions

35
libs/config.js Normal file
View File

@@ -0,0 +1,35 @@
"use strict";
var fs = require('fs'),
yaml = require('js-yaml'),
_ = require('lodash');
/**
* Load Application Configuration
*
* @param {String} confPath Path to the configuration file
* @return {Object} Application Configuration
*/
module.exports = (confPath) => {
var appconfig = {};
try {
appconfig = yaml.safeLoad(fs.readFileSync(confPath, 'utf8'));
} catch (ex) {
winston.error(ex);
process.exit(1);
}
return _.defaultsDeep(appconfig, {
title: "Requarks Wiki",
host: "http://localhost",
port: process.env.PORT,
wsPort: 8080,
db: "mongodb://localhost/wiki",
redis: null,
sessionSecret: null,
admin: null
});
};