Send a request

Create a JavaScript file 9.js so that when you run it with node 9.js, the computer will output an HTML file 9.html that displays each pokemon's name and image. There cannot be any JavaScript in the generated html file.

  1. Send a request to https://pokeapi.co/api/v2/pokemon/.
  2. Look at the response, you will notice that each pokemon has a url. You need to send another request for each pokemon to get the image url. It is located under sprites key of the object.
  3. Use the responses to create an HTML string to display the name and pokemon's image.
  4. Write the resulting string into a file using fs.writeFile

The img tag with the src attribute are instructions for the browser to get the image data from the url and display it. For example: put this tag into an html file to display a picture of a cat.

<img src="https://placekitten.com/g/200/300" />