If we try to run API requests against our application right now using a tool like a cURL or a Postman we will (rightfully) get an error message since we have no real framework in place to serve API requests. The good news is that Phoenix makes everything incredibly simple to build a new API with very, very little dependency on extra libraries to get everything put together.
In fact, building an API in Phoenix is such a simple endeavor that it has completely replaced my usual defaults of other languages and tools! Everything is given to you in some way or another without requiring a lot of extra work or configuration, and having an API live seamlessly side-by-side with the rest of your application is a breeze!
If we start off by making a request to our non-existing API routes, we will (as expected) get an error message. For purposes of this chapter, I'll be...