#!/bin/bash echo "=== YourPart CORS-Fix ===" # Backup der ursprünglichen app.js erstellen sudo cp /opt/yourpart/backend/app.js /opt/yourpart/backend/app.js.backup # CORS-Konfiguration aktualisieren sudo sed -i 's|origin: \[.*\]|origin: [\n "http://localhost:3000", \n "http://localhost:5173", \n "http://127.0.0.1:3000", \n "http://127.0.0.1:5173",\n "https://your-part.de",\n "https://www.your-part.de",\n "http://your-part.de",\n "http://www.your-part.de"\n ]|' /opt/yourpart/backend/app.js echo "CORS-Konfiguration aktualisiert!" # Service neu starten echo "Starte Backend-Service neu..." sudo systemctl restart yourpart.service # Status prüfen echo "Service-Status:" sudo systemctl status yourpart.service echo "" echo "CORS-Fix abgeschlossen! Testen Sie jetzt die Anwendung."