postgres db

This commit is contained in:
iPromKnight
2024-02-05 13:09:36 +00:00
committed by iPromKnight
parent ff4edd5de4
commit aeebe88aca

View File

@@ -1,11 +1,11 @@
export class DatabaseConfig {
public POSTGRES_HOST: string = process.env.POSTGRES_HOST || 'postgres';
public POSTGRES_PORT: number = parseInt(process.env.POSTGRES_PORT || '5432');
public POSTGRES_DATABASE: string = process.env.POSTGRES_DATABASE || 'knightcrawler';
public POSTGRES_DB: string = process.env.POSTGRES_DB || 'knightcrawler';
public POSTGRES_USER: string = process.env.POSTGRES_USER || 'postgres';
public POSTGRES_PASSWORD: string = process.env.POSTGRES_PASSWORD || 'postgres';
public get POSTGRES_URI() {
return `postgres://${this.POSTGRES_USER}:${this.POSTGRES_PASSWORD}@${this.POSTGRES_HOST}:${this.POSTGRES_PORT}/${this.POSTGRES_DATABASE}`;
return `postgres://${this.POSTGRES_USER}:${this.POSTGRES_PASSWORD}@${this.POSTGRES_HOST}:${this.POSTGRES_PORT}/${this.POSTGRES_DB}`;
}
}