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

      myFetch().then((blob) => {
        let objectURL = URL.createObjectURL(blob);
        let image = document.createElement('img');
        image.src = objectURL;
        document.body.appendChild(image);
      })
      .catch((e) =>
        console.log(e)
      );
    </script>
  </body>
</html>
