Configure remote database connection and update documentation

This commit is contained in:
Bivekich
2025-08-06 02:24:01 +03:00
parent 5bd7d79642
commit e1b79f017a
67 changed files with 1513 additions and 15 deletions

View File

@ -0,0 +1,3 @@
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { ConfigService } from '@nestjs/config';
export declare const getTypeOrmConfig: (configService: ConfigService) => TypeOrmModuleOptions;

17
backend/dist/config/typeorm.config.js vendored Normal file
View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTypeOrmConfig = void 0;
const getTypeOrmConfig = (configService) => ({
type: 'postgres',
host: configService.get('DATABASE_HOST') || 'localhost',
port: configService.get('DATABASE_PORT') || 5432,
username: configService.get('DATABASE_USERNAME') || 'postgres',
password: configService.get('DATABASE_PASSWORD') || 'postgres',
database: configService.get('DATABASE_NAME') || 'prism_messenger',
entities: [__dirname + '/../**/*.entity{.ts,.js}'],
migrations: [__dirname + '/../migrations/*{.ts,.js}'],
synchronize: configService.get('NODE_ENV') !== 'production',
logging: configService.get('NODE_ENV') !== 'production',
});
exports.getTypeOrmConfig = getTypeOrmConfig;
//# sourceMappingURL=typeorm.config.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"typeorm.config.js","sourceRoot":"","sources":["../../src/config/typeorm.config.ts"],"names":[],"mappings":";;;AAGO,MAAM,gBAAgB,GAAG,CAAC,aAA4B,EAAwB,EAAE,CAAC,CAAC;IACvF,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,WAAW;IACvD,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,IAAI;IAChD,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,UAAU;IAC9D,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,UAAU;IAC9D,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,iBAAiB;IACjE,QAAQ,EAAE,CAAC,SAAS,GAAG,0BAA0B,CAAC;IAClD,UAAU,EAAE,CAAC,SAAS,GAAG,2BAA2B,CAAC;IACrD,WAAW,EAAE,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,YAAY;IAC3D,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,YAAY;CACxD,CAAC,CAAC;AAXU,QAAA,gBAAgB,oBAW1B"}