add submodule

This commit is contained in:
Hri7566 2022-05-28 22:38:56 -04:00
parent e60e1fa6c2
commit 5785faad40
5 changed files with 12 additions and 6 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "mpp.hri7566.info"]
path = mpp.hri7566.info
url = git@gitlab.com:Hri7566/mpp.hri7566.info.git

0
http-server.js Normal file
View File

1
mpp.hri7566.info Submodule

@ -0,0 +1 @@
Subproject commit 91ff8343d35176eb8bcfb4c51396871a7ddac5b6

View File

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

View File

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