Created
March 9, 2020 16:36
-
-
Save transitive-bullshit/5bb75866d74663afec243c8fce4dd332 to your computer and use it in GitHub Desktop.
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 axios = require('axios'); | |
async function main () { | |
const url = 'https://octodex.github.com/images/original.png'; | |
const optimized = await axios.post('https://ssfy.sh/dev/imagemin/optimizeImageUrl', { url }, { | |
responseType: 'arraybuffer' | |
}); | |
console.log('optimized', { status: optimized.status, size: optimized.data.length }); | |
return optimized; | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment