mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-19 11:52:20 -06:00
init project evolution api
This commit is contained in:
14
src/db/db.connect.ts
Normal file
14
src/db/db.connect.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import mongoose from 'mongoose';
|
||||
import { configService, Database } from '../config/env.config';
|
||||
import { Logger } from '../config/logger.config';
|
||||
|
||||
const logger = new Logger('Db Connection');
|
||||
|
||||
export const db = configService.get<Database>('DATABASE');
|
||||
export const dbserver = db.ENABLED
|
||||
? mongoose.createConnection(db.CONNECTION.URI, {
|
||||
dbName: db.CONNECTION.DB_PREFIX_NAME + '-whatsapp-api',
|
||||
})
|
||||
: null;
|
||||
|
||||
db.ENABLED ? logger.info('ON - dbName: ' + dbserver['$dbName']) : null;
|
||||
Reference in New Issue
Block a user