Skip to the content.

Why Another ZIO/Http4s Client Example?

There are a couple of sample projects already in existence showing you how to use zio with http4s as a server. So why another?

What this adds to the mix are 3 things that might be independently useful:

For a detailed description of the various libraries you should head on over to the relevant pages. However, if, like me, you sometimes struggle a bit to get everything working together, then this may help. Also, I find some of the other zio coding examples a little daunting, as authors cram multiple concepts into a small sample. These examples are rather more spread out. If this means it’s a little dull for some of you, please go straight to the source code on github!

I don’t claim to be an expert in this stuff. But we do have 4 microservices using this combination already in production and although processing volumes are low, they do seem to work!

I will not attempt to explain either of these libraries, but briefly, ZIO is the latest in a series of scala effects libraries which includes cats.IO and Monix. Http4s is a popular typelevel web framework based on the Blaze server (there is also a client).

These examples

The github project contains 4 sets of services that can be treated as a progression from simplest to most complex:

The blog is broken into