Creating RESTful services with Go — Part 2
In this blog, we are going to be building a fully-fledged REST API that exposes GET, POST, DELETE, and PUT endpoints that will subsequently allow you to perform the full range of CRUD operations. As mentioned in the previous article, the blog series will encapsulate a production-ready project. Thus, this part of the blog will lay the groundwork for an online coffee shop.
The code for this part of the blog will be hosted here: https://github.com/nandangrover/go-microservices. The second part of the series, which is what this blog documents can be found in this branch.
To keep this simple and focus on the basic concepts, we won’t be interacting with any backend database technologies to store the products that we’ll be playing with. However, we will be writing this REST API in such a way that it will be easy to update the functions we will be defining so that they make subsequent calls to a database to perform any necessary CRUD operations.
What are the RESTful services?
REST is an architectural approach for designing web services. REST APIs are designed around resources, which are any kind of object, data, or service that can be accessed by the client. A resource has an identifier, which is a URI that uniquely identifies that resource. For example, the URI for a particular…