diff --git a/.env.example b/.env.example index 7975ba4..f014e2a 100644 --- a/.env.example +++ b/.env.example @@ -1,18 +1,19 @@ # Diese Werte in Coolify als Environment-Variablen setzen (NICHT committen). -# Welche Website darf das Formular abschicken (CORS). Kommagetrennt möglich. -ALLOWED_ORIGIN=https://atilgan-gartenbau.de,https://www.atilgan-gartenbau.de +# Welche Website darf das Formular abschicken (CORS). Bei same-origin (/api auf +# derselben Domain) unkritisch; zur Sicherheit die Live-Domain eintragen. +ALLOWED_ORIGIN=https://atilgan-gartenbau.de -# SMTP-Zugang des Postfachs, über das gesendet wird +# SMTP-Zugang des Versand-Postfachs SMTP_HOST=mail.euer-provider.de SMTP_PORT=587 -SMTP_SECURE=false # true bei Port 465 -SMTP_USER=info@adnan-atilgan.de -SMTP_PASS=euer-postfach-passwort +SMTP_SECURE=false # true bei Port 465 +SMTP_USER=webseite@atilgan-gartenbau.de +SMTP_PASS=passwort-des-postfachs # Empfänger & Absender MAIL_TO=info@adnan-atilgan.de -MAIL_FROM=info@adnan-atilgan.de +MAIL_FROM=webseite@atilgan-gartenbau.de MAIL_SUBJECT_PREFIX=[Webseite] # Port (Coolify setzt den i. d. R. selbst) diff --git a/server.js b/server.js index 0585cd5..e5e119d 100644 --- a/server.js +++ b/server.js @@ -63,7 +63,7 @@ app.get('/', (_req, res) => res.json({ ok: true, service: 'kontakt-api' })); app.get('/health', (_req, res) => res.json({ ok: true })); // --- Formular-Endpunkt --- -app.post('/api/kontakt', limiter, async (req, res) => { +app.post(['/api/kontakt', '/kontakt'], limiter, async (req, res) => { try { const b = req.body || {};