Last active
December 29, 2020 12:20
-
-
Save etc-tiago/98db34fd055fd2801521bae5f19c79fb to your computer and use it in GitHub Desktop.
Purge Cache CloudFlare
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require("isomorphic-unfetch"); | |
fetch("https://api.cloudflare.com/client/v4/zones/95bf6374709dc5a530c1e74476b580bc/purge_cache", { | |
method: "POST", | |
headers: { | |
"X-Auth-Email": "YOUR_EMAIL_DASHBOARD_HERE", | |
Authorization: "Bearer YOUR_TOKEN_HERE", | |
"Content-Type": "application/json", | |
}, | |
body: JSON.stringify({ purge_everything: true }), | |
}).then((r) => { | |
console.log("Purge Cache"); | |
return r.json(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment