refactor: Update service dependency and logger names in app.ts

This commit simplifies the database service dependency by importing 'justForTesting' method from the simplified databases.service. It also renames the logger instance and environment files from "App" to "OnlyDevs". Removed unnecessary test function using mongo and mariadb services.
This commit is contained in:
Mathis 2024-05-14 23:34:09 +02:00
parent 9b9b635989
commit 9c97420027

View File

@ -1,17 +1,16 @@
import * as process from "node:process";
import { MongodbService } from "@services/databases/mongodb.service";
import { EnvUtils } from "@utils/env.util";
import { LogsUtils } from "@utils/logs.util";
import compression from "compression";
import cors from "cors";
import express, { type Express } from "express";
import helmet from "helmet";
import {MariadbService} from "@services/databases/mariadb.service";
import {justForTesting} from "@services/databases/databases.service";
console.log("\n\n> Starting...\n\n\n\n");
const logger = new LogsUtils("App");
const envs = new EnvUtils("App");
const logger = new LogsUtils("OnlyDevs");
const envs = new EnvUtils("OnlyDevs");
const app: Express = express();
@ -64,14 +63,4 @@ try {
process.exit(1);
}
async function test() {
const mongo = new MongodbService("App");
const maria = new MariadbService('App');
logger.debug('Testing...')
return await mongo.use().collection('testing').countDocuments()
}
test().then((r)=>{
logger.info(r)
})
justForTesting.getAllUsers()