The Bitty Baking API – Building an API and Testing with Postman

Jul 13, 2021

keyword-counter-hero

About the Bitty Baking API

I’ve been learning a lot about APIs recently, and I thought it would be fun to build and test my own API—so I did!

The Bitty Baking API is built with Node, Express, and MySQL. It allows you to check the status of the API, view all menu items at the bakery, view a specific menu item, read a list of all orders, and create, read, update, and delete a single order. There are 5 menu items to choose from: chocolate chip cookie, sugar cookie, lemon cookie, chocolate cupcake, or vanilla cupcake. To place an order, you need to provide a customer name and menu item. There’s more information in the documentation, which you can check out on GitHub.

What I learned

Building my own API from scratch gave me a much deeper understanding about what goes into an API. I’ve used APIs in my previous projects but when designing the Bitty Baking API, I had to think critically about the underlying database structure, the queries I wanted to be able to run, the endpoints needed to run those queries, and the dependencies for those queries. 

And then, from the user perspective, I had to determine what data to send back to the user for successful requests and how to write useful error messages for the unsuccessful ones. I also had to determine the best status code to send with each response. For the documentation, I had to write up clear instructions for how to set up and use the API. 

Testing with Postman

Once I’d written the API, I tested it with Postman. I had used Postman a bit in the past, but this project gave me a much better understanding of its potential. And it’s weirdly fun to use—I’m definitely eager to learn more! 

I’ve included a video of my API testing below, and I’ve posted the code and documentation for the Bitty Baking API and Postman tests on GitHub. Feel free to check them out!

Never miss a post!
Subscribe to the blog and get updates every two weeks!