more stuff

Former-commit-id: 64e53142b2958f6eff493c071bbbcc77ee6f0117
This commit is contained in:
Ben
2022-02-14 17:15:21 +00:00
parent 13a4ee3151
commit da9b72eae0
5 changed files with 14 additions and 18 deletions

View File

@@ -19,9 +19,8 @@ function load() {
}
});
}
}
module.exports = {
Load: load
}
Load: load,
};

View File

@@ -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)) {

View File

@@ -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}`);

View File

@@ -1,7 +1,5 @@
const Server = require('/routes/server.js');
module.exports = {
}
};

View File

@@ -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,
};