Skip to content

Instantly share code, notes, and snippets.

@duhaime
Created May 8, 2020 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duhaime/c6296839b461de645875629330813935 to your computer and use it in GitHub Desktop.
Save duhaime/c6296839b461de645875629330813935 to your computer and use it in GitHub Desktop.
Fetch from localhost
// NB: To load from localhost one can:
fetch(url)
.then(response => response.blob())
.then(async image => {
const img = document.createElement('img');
img.src = URL.createObjectURL(image);
img.onload = async () => {}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment