If we want other people to use our API, then we have to document how to use it. People can't see the code on our servers, so we have to tell them how to interact with our servers via the API constraints.
e.g. What are the routes, what are the required parameters etc.
Luckily for us, if you made all your requests in Postman and you gave each request a name and description then Postman will generate the documentation automatically for you.
1. Make sure that you've made each of the requests and they work as you expect.
2. Make sure all the requests are saved in the same collection e.g. My collection is called Cafe & Wifi:
3. Click on the three dots next to your collection name and go to "Publish Docs":
4. Go through the steps to publish your documentation and this is what you should end up with:
e.g. Here's mine: https://documenter.getpostman.com/view/2568017/TVRhd9qR
5. We can now edit out index.html to include an anchor tag to our API's documentation.
You can find the completed project solution code in this lesson's resources.