more stuff
Former-commit-id: 64e53142b2958f6eff493c071bbbcc77ee6f0117
This commit is contained in:
@@ -19,9 +19,8 @@ function load() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
Load: load
|
||||
}
|
||||
Load: load,
|
||||
};
|
||||
|
||||
@@ -10,16 +10,15 @@ let dateFormat = 'DD-MM-YY HH:mm:ss'
|
||||
|
||||
// must be ran after the config is initalised
|
||||
// TODO: network logs
|
||||
module.exports.Init = async function(path) {
|
||||
module.exports.Init = function (path) {
|
||||
if (path) logPath = path;
|
||||
|
||||
// ALWAYS logs to console, others are aditionals
|
||||
switch (process.env.LOG_TARGET)
|
||||
{
|
||||
case 'console':
|
||||
case 'file':
|
||||
case 'network':
|
||||
default:
|
||||
switch (process.env.LOG_TARGET) {
|
||||
case 'console':
|
||||
case 'file':
|
||||
case 'network':
|
||||
default:
|
||||
}
|
||||
|
||||
if (!fs.existsSync(logPath)) {
|
||||
|
||||
@@ -3,8 +3,8 @@ const fs = require('fs');
|
||||
function init(databaseInstance) {
|
||||
module.exports.Database = databaseInstance;
|
||||
module.exports.Models = {};
|
||||
|
||||
let files = fs.readdirSync(__dirname).reverse();
|
||||
|
||||
const files = fs.readdirSync(__dirname).reverse();
|
||||
files.forEach(file => {
|
||||
if (file !== 'model-manager.js') {
|
||||
const model = require(`./${file}`);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
const Server = require('/routes/server.js');
|
||||
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,8 +12,8 @@ function logRequest(req, res, next)
|
||||
function listen(port) {
|
||||
app.listen(port);
|
||||
Logger.Info(`Listening on ${port}...`);
|
||||
|
||||
Logger.Info(`Setting up basic middleware...`);
|
||||
|
||||
Logger.Info('Setting up basic middleware...');
|
||||
app.use(logRequest);
|
||||
|
||||
app.use(express.static('client/public/'));
|
||||
@@ -21,5 +21,5 @@ function listen(port) {
|
||||
|
||||
module.exports = {
|
||||
App: app,
|
||||
Listen: listen
|
||||
Listen: listen,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user