diff --git a/.env b/.env index 1e2957c..2f87629 100644 --- a/.env +++ b/.env @@ -2,3 +2,4 @@ ADMINPASS=burgerass SALT=๖ۣۜH͜r̬i͡7566 MONGO_URL=mongodb://127.0.0.1/?authSource=admin&readPreference=primary&appname=MongoDB%20Compass&ssl=false SSL=false +SERVE_FILES=true diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6ad8a50 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "mpp.hri7566.info"] + path = mpp.hri7566.info + url = git@gitlab.com:Hri7566/mpp.hri7566.info.git diff --git a/http-server.js b/http-server.js new file mode 100644 index 0000000..e69de29 diff --git a/mpp.hri7566.info b/mpp.hri7566.info new file mode 160000 index 0000000..91ff834 --- /dev/null +++ b/mpp.hri7566.info @@ -0,0 +1 @@ +Subproject commit 91ff8343d35176eb8bcfb4c51396871a7ddac5b6 diff --git a/src/Database.js b/src/Database.js index 247aad6..762dbad 100644 --- a/src/Database.js +++ b/src/Database.js @@ -12,11 +12,13 @@ var logger = new Logger("Database"); mongoose.connect(process.env.MONGO_URL, { useNewUrlParser: true, - useUnifiedTopology: true + useUnifiedTopology: true, + connectTimeoutMS: 1000 }, err => { if (err) { console.error(err); - return; + logger.error("Unable to connect to database service"); + process.exit(1); } logger.log("Connected"); }); diff --git a/src/Logger.js b/src/Logger.js index 2f1411e..8ca6cdb 100644 --- a/src/Logger.js +++ b/src/Logger.js @@ -6,20 +6,20 @@ class Logger { } log(args) { - console.log(chalk.green(`[${this.context}]`), args); + console.log(chalk.blue(`[INFO] [${this.context}]`), args); } warn(args) { - console.warn(chalk.yellow(`[WARN] [${this.context}]`), args); + console.warn(chalk.yellow(`[WARNING] [${this.context}]`), args); } error(args) { - console.error(chalk.red(`[ERR] [${this.context}]`), args); + console.error(chalk.red(`[ERROR] [${this.context}]`), args); } debug(args) { if (process.env.DEBUG_ENABLED) { - console.log(chalk.blue(`[DEBUG] [${this.context}]`), args); + console.log(chalk.green(`[DEBUG] [${this.context}]`), args); } } }