2.0 KiB
2.0 KiB
🚀 Quick Start - Lokaler Reverse Proxy
Sofort loslegen
Terminal 1: Proxy Server starten
./start-proxy.sh
Oder manuell:
cd proxy-server
node server.js
Terminal 2: Flutter App starten
flutter run -d chrome
✅ Das wars!
Die App verwendet jetzt automatisch den lokalen Proxy auf http://localhost:3000 für Geocoding.
🔧 Konfiguration
In lib/config/environment.dart:
static const bool useLocalProxy = true; // true = Proxy, false = Appwrite Function
📋 Checkliste
- ✅ Node.js installiert (
node --version) - ✅ Proxy läuft (
http://localhost:3000im Browser) - ✅
useLocalProxy = truein environment.dart - ✅ Flutter App läuft
🎯 Vorteile Lokaler Proxy
✅ Kein CORS-Problem - Server umgeht Browser-Beschränkungen
✅ Schnelles Testen - Kein Cloud-Deployment nötig
✅ Einfaches Debugging - Logs direkt im Terminal
✅ Kostenlos - Läuft lokal, keine Cloud-Kosten
🌐 Für Produktion
Für den Live-Betrieb:
- Setzen Sie
useLocalProxy = false - Deployen Sie die Appwrite Function (siehe DEPLOYMENT.md)
- Tragen Sie die Function ID ein
📊 Vergleich
| Feature | Lokaler Proxy | Appwrite Function |
|---|---|---|
| Setup Zeit | < 1 Minute | ~10 Minuten |
| CORS | ✅ Gelöst | ✅ Gelöst |
| Kosten | Kostenlos | Serverless (minimal) |
| Verwendung | Nur Entwicklung | Entwicklung + Produktion |
| Debugging | Sehr einfach | Logs in Console |
| Offline | ❌ | ❌ |
🐛 Problemlösung
Proxy startet nicht:
# Port 3000 belegt?
lsof -i :3000
# Prozess beenden
kill -9 <PID>
App findet Proxy nicht:
- Proxy läuft? Prüfen Sie
http://localhost:3000im Browser useLocalProxy = true? Prüfen Sie environment.dart- Hot Restart in Flutter machen
Immer noch CORS-Fehler:
- Browser-Cache leeren
- DevTools → Network → "Disable cache"
- App neu builden:
flutter run -d chrome