The implementation of the HTTP interface in our project is based on the http4s (https://http4s.org) library. http4s is built on top of the FS2 and Cats IO and therefore we have a nice interplay with the persistence layer implemented with doobie. With http4s, it is possible to build functional server-side services using high-level DSL, as well as use it on the client-side to call HTTP APIs. We will use the client functionality to build an integration test for our API later in this chapter.
The server side is represented by HttpService[F], which is essentially just a mapping from Request to F[Response] and F is a cats IO in our case. http4s DSL helps to construct such RESTful services by using pattern-matching.
This ...