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:
parent
9b9b635989
commit
9c97420027
19
src/app.ts
19
src/app.ts
@ -1,17 +1,16 @@
|
|||||||
import * as process from "node:process";
|
import * as process from "node:process";
|
||||||
import { MongodbService } from "@services/databases/mongodb.service";
|
|
||||||
import { EnvUtils } from "@utils/env.util";
|
import { EnvUtils } from "@utils/env.util";
|
||||||
import { LogsUtils } from "@utils/logs.util";
|
import { LogsUtils } from "@utils/logs.util";
|
||||||
import compression from "compression";
|
import compression from "compression";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
import express, { type Express } from "express";
|
import express, { type Express } from "express";
|
||||||
import helmet from "helmet";
|
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");
|
console.log("\n\n> Starting...\n\n\n\n");
|
||||||
|
|
||||||
const logger = new LogsUtils("App");
|
const logger = new LogsUtils("OnlyDevs");
|
||||||
const envs = new EnvUtils("App");
|
const envs = new EnvUtils("OnlyDevs");
|
||||||
|
|
||||||
const app: Express = express();
|
const app: Express = express();
|
||||||
|
|
||||||
@ -64,14 +63,4 @@ try {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function test() {
|
justForTesting.getAllUsers()
|
||||||
|
|
||||||
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)
|
|
||||||
})
|
|
Loading…
x
Reference in New Issue
Block a user