Fix tous les appels API pour utiliser getApiUrl() au lieu de process.env
All checks were successful
Build and Push Docker Images / Build Frontend Image (push) Successful in 3m31s
All checks were successful
Build and Push Docker Images / Build Frontend Image (push) Successful in 3m31s
Problème: Le commit précédent n'avait corrigé que api.ts, mais AudioPlayer et page.tsx utilisaient encore directement process.env.NEXT_PUBLIC_API_URL, ce qui ignorait la config runtime. Fichiers corrigés: 1. lib/api.ts: - Export getApiUrl() pour usage externe 2. app/page.tsx: - Import getApiUrl - /api/library/scan: process.env → getApiUrl() - /api/library/scan/status: process.env → getApiUrl() 3. components/AudioPlayer.tsx: - Import getApiUrl - /api/audio/waveform: process.env → getApiUrl() - /api/audio/stream: process.env → getApiUrl() - /api/audio/download: process.env → getApiUrl() Maintenant TOUS les appels API utilisent la config runtime (window.__RUNTIME_CONFIG__) côté client. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ import type {
|
||||
} from './types'
|
||||
|
||||
// Get API URL from runtime config (injected at container startup) or fallback to env var
|
||||
function getApiUrl(): string {
|
||||
export function getApiUrl(): string {
|
||||
if (typeof window !== 'undefined' && (window as any).__RUNTIME_CONFIG__) {
|
||||
return (window as any).__RUNTIME_CONFIG__.API_URL
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user