I have an http4s HttpRoutes
and a task in my effect type (ZIO, if that matters). The effect is side-effecting and returns no value. I want to compose the two together, creating a new HttpRoutes
that will run the effect before any matching route in the HttpRoutes
.
import zio.Task
val httpRoutes: HttpRoutes[Task] = ...
val effect: Task[Unit] = ...
val combined: HttpRoutes[Task] = ???
How do I combine the HttpRoutes
and the effect together?