Created
May 8, 2020 17:53
-
-
Save duhaime/c6296839b461de645875629330813935 to your computer and use it in GitHub Desktop.
Fetch from localhost
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
// 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