<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Simple fetch() with async/await</title>
  </head>
  <body>
    <script>
      async function myFetch() {
        try {
          let response = await fetch('coffee.jpg');
          let myBlob = await response.blob();

          let objectURL = URL.createObjectURL(myBlob);
          let image = document.createElement('img');
          image.src = objectURL;
          document.body.appendChild(image);
        } catch(e) {
          console.log(e);
        }
      }

      myFetch();
    </script>
  </body>
</html>
