API 参考
基址:https://api.gitflare.net/v1。使用 Bearer 令牌认证。
基址 https://api.gitflare.net/v1。全部走 HTTPS。
认证
$ curl -sS https://api.gitflare.net/v1/accounts/me \ -H "Authorization: Bearer $GITFLARE_API_TOKEN"
用打包脚本创建 Worker
$ tar -C dist -czf bundle.tgz . $ curl -sS -X PUT https://api.gitflare.net/v1/workers/checkout-api \ -H "Authorization: Bearer $GITFLARE_API_TOKEN" \ -H "Content-Type: application/gzip" \ --data-binary @bundle.tgz
刷新缓存
await fetch("https://api.gitflare.net/v1/zones/example.com/purge", {
method: "POST",
headers: { authorization: `Bearer ${token}`, "content-type": "application/json" },
body: JSON.stringify({ prefixes: ["/assets/"] }),
});
列出 DNS 记录
$ curl -sS "https://api.gitflare.net/v1/zones/example.com/dns?type=A" \ -H "Authorization: Bearer $GITFLARE_API_TOKEN"