diff --git a/.replit b/.replit index c806144..b84d8c1 100644 --- a/.replit +++ b/.replit @@ -40,3 +40,4 @@ args = "npm run dev" waitForPort = 5000 [agent] +integrations = ["javascript_database==1.0.0"] diff --git a/server/storage.ts b/server/storage.ts index f090ff0..01d5569 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -1154,38 +1154,18 @@ let storage: IStorage; const hasDatabase = process.env.DATABASE_URL; const hasBunnyConfig = process.env.BUNNY_API_KEY && process.env.BUNNY_LIBRARY_ID && process.env.BUNNY_HOSTNAME; -// Use hybrid storage when both Bunny.net and Database are available -if (hasBunnyConfig && hasDatabase) { - try { - storage = new HybridStorage(); - console.log('✅ Using Hybrid storage (Bunny.net for videos + Database for users)'); - } catch (error) { - console.error('❌ Failed to initialize Hybrid storage:', error); - console.log('📁 Falling back to memory storage'); - storage = new MemStorage(); - } -} -// Prioritize Bunny.net storage for video content only -else if (hasBunnyConfig) { - try { - storage = new BunnyStorage(); - console.log('✅ Using Bunny.net storage with library ID:', process.env.BUNNY_LIBRARY_ID); - } catch (error) { - console.error('❌ Failed to initialize Bunny.net storage:', error); - console.log('📁 Falling back to memory storage'); - storage = new MemStorage(); - } -} else if (hasDatabase) { +// Force PostgreSQL database storage +if (hasDatabase) { try { storage = new DatabaseStorage(); - console.log('✅ Using PostgreSQL database storage'); + console.log('✅ Using PostgreSQL database storage ONLY'); } catch (error) { console.error('❌ Failed to initialize database storage:', error); console.log('📁 Falling back to memory storage'); storage = new MemStorage(); } } else { - console.log('📁 Using memory storage (no database or Bunny.net config found)'); + console.log('📁 Using memory storage (no database config found)'); storage = new MemStorage(); }