chore: debug logs

This commit is contained in:
Oleg Proskurin 2025-10-12 16:42:33 +07:00
parent 1b3a357b5d
commit eb11db753e
2 changed files with 5 additions and 5 deletions

View File

@ -2,16 +2,14 @@ import { createDbClient } from '@banatie/database';
import { config } from 'dotenv';
import path from 'path';
// Load .env from api-service directory BEFORE reading env vars
// __dirname in tsx points to src directory, so ../.env goes to api-service/.env
config({ path: path.join(__dirname, '../.env'), debug: true });
// Load .env from api-service directory and OVERRIDE shell env vars
// This is needed because docker-compose sets DATABASE_URL for Docker network
config({ path: path.join(__dirname, '../.env'), override: true });
const DATABASE_URL =
process.env['DATABASE_URL'] ||
'postgresql://banatie_user:banatie_secure_password@localhost:5434/banatie_db';
console.log('[DB] Using DATABASE_URL:', DATABASE_URL);
export const db = createDbClient(DATABASE_URL);
console.log(

View File

@ -80,6 +80,8 @@ export class StorageFactory {
const bucketName = process.env['MINIO_BUCKET_NAME'] || 'banatie';
const publicUrl = process.env['MINIO_PUBLIC_URL'];
console.log(`[StorageFactory] Creating MinIO client with endpoint: ${endpoint}`);
if (!endpoint || !accessKey || !secretKey) {
throw new Error(
'MinIO configuration missing. Required: MINIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY',