本篇文章將示範如何取得 wrangler 需要的 API_TOKEN
Step 1: Click My Profile

Step 2: Click Create Token

Step 3: Use template Edit Cloudflare Workers

Step 4: Edit detail permissions
這邊會使用:
- Workers KV Storage: Key-Value 儲存服務。
- Workers Scripts: Serverless Code。
- Workers Routes: DNS 到 worker scripts 這段的 route。
Account Resources: 你要使用哪個 Account/Group 的 domain。
Zone Resources: 你要使用哪個 zone (domain)。

Step 5: Create Token

Step 6: Result

使用 curl 測試剛剛取得的 API Token
$ curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \ |
{"result":{"id":"9183fa3b63cc3129b652b0fabddc14d8","status":"active"},"success":true,"errors":[],"messages":[{"code":10000,"message":"This API Token is valid and active","type":null}]} |