neues docker-compose für Profuktion und Anpassungen

This commit is contained in:
rxf
2026-02-10 20:22:44 +01:00
parent f32e472ea3
commit 4fde7ed46a
4 changed files with 292 additions and 3 deletions

View File

@@ -17,8 +17,14 @@ function App() {
setLastUpdate(new Date())
setLoading(false)
} else {
// Entwicklungsmodus: Daten von API holen
const response = await fetch('http://localhost:8000/weather/history?hours=24')
// Development oder Production: Daten von API holen
// Im Development: localhost:8000
// Im Production: /api/ (nginx proxy)
const apiUrl = import.meta.env.DEV
? 'http://localhost:8000/weather/history?hours=24'
: '/api/weather/history?hours=24'
const response = await fetch(apiUrl)
if (!response.ok) {
throw new Error('API-Fehler: ' + response.status)
}