Last active
October 19, 2020 13:13
-
-
Save julioklein/192f4d1cc7e0478167268fba42ddce0b to your computer and use it in GitHub Desktop.
Imgix Purge with NodeJS
This file contains hidden or 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 axios = require('axios').default; | |
const API_KEY = '' | |
const url = 'http://examples.imgix.net/frog.jpg'; | |
axios.post('https://api.imgix.com/v2/image/purger', { url }, { | |
auth: { | |
username: API_KEY, | |
password: '' | |
} | |
}) | |
.then(response => console.log('success purging img')) | |
.catch(error => console.log('error purging img ', error.message)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment