Cloudflare Workers Deployment
Cloudflare Workers Deployment
Abschnitt betitelt „Cloudflare Workers Deployment“Anleitung zum Deployment auf Cloudflare Workers.
Voraussetzungen
Abschnitt betitelt „Voraussetzungen“- Cloudflare Account
- Wrangler CLI installiert
- KV Namespaces erstellt
- Secrets konfiguriert
Development
Abschnitt betitelt „Development“Lokale Entwicklung:
wrangler devDer Worker ist dann unter http://localhost:8787 verfügbar.
Production Deployment
Abschnitt betitelt „Production Deployment“wrangler deployStaging/Production Environments
Abschnitt betitelt „Staging/Production Environments“Du kannst mehrere Environments in wrangler.toml definieren:
[env.staging]name = "oauth-auth-staging"[[env.staging.kv_namespaces]]binding = "AUTH_KV"id = "staging-kv-id"
[env.production]name = "oauth-auth-production"[[env.production.kv_namespaces]]binding = "AUTH_KV"id = "production-kv-id"Deploy zu einem Environment:
wrangler deploy --env stagingwrangler deploy --env productionCustom Domain
Abschnitt betitelt „Custom Domain“- Gehe zu Cloudflare Dashboard
- Wähle deinen Worker
- Gehe zu “Triggers” → “Custom Domains”
- Füge deine Domain hinzu (z.B.
auth.deine-domain.de)
Logs ansehen
Abschnitt betitelt „Logs ansehen“wrangler tailNächste Schritte
Abschnitt betitelt „Nächste Schritte“- Umgebungsvariablen - Secrets konfigurieren
- KV Storage - KV Namespace verwalten