Testing the API

Running the API on Local Host:

To test the API, We have to run it on our localhost. We can do that by following the same steps described in Section 2 of this Lab.

Once we run the server, We will see a similar page as before.

For Task 1, We used the route "/movies". We can test that by writing the same in the end. We can see that the API shows us the complete database of movies in response to this request.

Now, For Task 2 we used the route "/movies/x" where x is the rank of the movie. We can test that by writing the same in the end. We can see that the API shows us the movie corresponding to the input rank in response to this request.

With this our API is complete.

Good luck! Share with me what you’ve been able to create!

Discussion

5

0