feat(ops): replace Cloudflare Pages with Workers for frontend hosting
This commit is contained in:
1 parent
9ac1a8b79d
commit
9e56ff7859
16 files changed
+214
-283
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
Reference for Cloudflare account and API token troubleshooting.
|
||||
|
||||
Use `https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/pages/projects` to verify the account ID and API token are valid.
|
||||
Use `wrangler whoami` to verify the account ID and API token are valid, or query the Workers API at `https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/workers/scripts`.
|
||||
|
||||
## Validate Cloudflare account and API token
|
||||
|
||||
@@ -12,13 +12,13 @@ Set-Location -Path "E:\Documents\02-Projects\07-Mentoring\Corey\linearvoid"
|
||||
Get-Content .env | Select-String 'CLOUDFLARE_API_TOKEN'
|
||||
Get-Content .env | Select-String 'CLOUDFLARE_ACCOUNT_ID'
|
||||
|
||||
# Test API token with curl
|
||||
# Test API token with wrangler
|
||||
npx wrangler whoami
|
||||
|
||||
# Or verify with the Workers API directly
|
||||
$env:CLOUDFLARE_API_TOKEN = (Get-Content .env | Select-String 'CLOUDFLARE_API_TOKEN' | ForEach-Object { $_.Line.Split('=')[1].Trim() })
|
||||
$env:CLOUDFLARE_ACCOUNT_ID = (Get-Content .env | Select-String 'CLOUDFLARE_ACCOUNT_ID' | ForEach-Object { $_.Line.Split('=')[1].Trim() })
|
||||
|
||||
# List all Pages projects for the account
|
||||
curl -X GET "https://api.cloudflare.com/client/v4/accounts/$env:CLOUDFLARE_ACCOUNT_ID/pages/projects" -H "Authorization: Bearer $env:CLOUDFLARE_API_TOKEN" -H "Content-Type: application/json"
|
||||
|
||||
# Create a new Pages project (if needed)
|
||||
# curl -X POST "https://api.cloudflare.com/client/v4/accounts/$env:CLOUDFLARE_ACCOUNT_ID/pages/projects" -H "Authorization: Bearer $env:CLOUDFLARE_API_TOKEN" -H "Content-Type: application/json" -d '{"name":"linearvoid","production_branch":"main"}'
|
||||
# List all Workers for the account
|
||||
curl -X GET "https://api.cloudflare.com/client/v4/accounts/$env:CLOUDFLARE_ACCOUNT_ID/workers/scripts" -H "Authorization: Bearer $env:CLOUDFLARE_API_TOKEN" -H "Content-Type: application/json"
|
||||
```
|
||||
Reference in new issue
Block a user