Assignment

1. Extend your webserver

In the session, you added plenty of useful routes to your API, but let's not stop there!

  1. Add 3 new routes

    Think of 3 new useful routes yourself, and implement them.

  2. Extend the home route

    Routes don't only have to return text or JSON, they can also return HTML content to be displayed in the browser.

    Update the / route to return a HTML page that fetches the count value from the /user-count route you've implemented previously. Style the HTML so it displays in a visually pleasing way. Now you've created a nice page to view the total number of users in your database!

2. Practice using Postman

Who doesn't love dogs? Ok... save the cat vs dog debate until after you've completed this exercise!

You'll be using the Dog API, where you can retrieve lots of doggy pictures. You can find the documentation on their website dog.ceo/dog-api.

You should create a collection in Postman, and set up requests for each of these tasks:

  1. Get 5 random dog images (any breed)

  2. List all the dog breeds

  3. Get 3 dog images from the "beagle" breed

  4. List all the sub-breeds of the poodle

  5. Get all the dog images from the "toy poodle" sub breed

Share the link to your saved Postman Collection as part of submitting this assignment.

Last updated