chore: debug logs
This commit is contained in:
parent
1b3a357b5d
commit
eb11db753e
|
|
@ -2,16 +2,14 @@ import { createDbClient } from '@banatie/database';
|
||||||
import { config } from 'dotenv';
|
import { config } from 'dotenv';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
// Load .env from api-service directory BEFORE reading env vars
|
// Load .env from api-service directory and OVERRIDE shell env vars
|
||||||
// __dirname in tsx points to src directory, so ../.env goes to api-service/.env
|
// This is needed because docker-compose sets DATABASE_URL for Docker network
|
||||||
config({ path: path.join(__dirname, '../.env'), debug: true });
|
config({ path: path.join(__dirname, '../.env'), override: true });
|
||||||
|
|
||||||
const DATABASE_URL =
|
const DATABASE_URL =
|
||||||
process.env['DATABASE_URL'] ||
|
process.env['DATABASE_URL'] ||
|
||||||
'postgresql://banatie_user:banatie_secure_password@localhost:5434/banatie_db';
|
'postgresql://banatie_user:banatie_secure_password@localhost:5434/banatie_db';
|
||||||
|
|
||||||
console.log('[DB] Using DATABASE_URL:', DATABASE_URL);
|
|
||||||
|
|
||||||
export const db = createDbClient(DATABASE_URL);
|
export const db = createDbClient(DATABASE_URL);
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,8 @@ export class StorageFactory {
|
||||||
const bucketName = process.env['MINIO_BUCKET_NAME'] || 'banatie';
|
const bucketName = process.env['MINIO_BUCKET_NAME'] || 'banatie';
|
||||||
const publicUrl = process.env['MINIO_PUBLIC_URL'];
|
const publicUrl = process.env['MINIO_PUBLIC_URL'];
|
||||||
|
|
||||||
|
console.log(`[StorageFactory] Creating MinIO client with endpoint: ${endpoint}`);
|
||||||
|
|
||||||
if (!endpoint || !accessKey || !secretKey) {
|
if (!endpoint || !accessKey || !secretKey) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'MinIO configuration missing. Required: MINIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY',
|
'MinIO configuration missing. Required: MINIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue