Skip to content

Instantly share code, notes, and snippets.

@julioklein
Last active October 19, 2020 13:13
Show Gist options
  • Save julioklein/192f4d1cc7e0478167268fba42ddce0b to your computer and use it in GitHub Desktop.
Save julioklein/192f4d1cc7e0478167268fba42ddce0b to your computer and use it in GitHub Desktop.
Imgix Purge with NodeJS
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