neues docker-compose für Profuktion und Anpassungen
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user