From 9c974200279c7e3038c62ed6fc5bfbb5728d6b10 Mon Sep 17 00:00:00 2001 From: Mathis Date: Tue, 14 May 2024 23:34:09 +0200 Subject: [PATCH] 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. --- src/app.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/app.ts b/src/app.ts index 3479034..827eb72 100644 --- a/src/app.ts +++ b/src/app.ts @@ -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) -}) \ No newline at end of file +justForTesting.getAllUsers() \ No newline at end of file