A simple syntax extension to add middleware to all subsequently mounted routes.
Add the following to your build.sbt
:
resolvers += Resolver.bintrayRepo("hgiddens", "maven")
libraryDependencies += "com.github.hgiddens" %% "http4s-global-middleware" % <version>
import com.github.hgiddens.http4s.middleware.global.Syntax._
import com.http4s.server.ServerBuilder
def serverBuilder: ServerBuilder = ???
serverBuilder.
globalMiddleware(a).
globalMiddleware(b).
mountService(c)
// Is equivalent to
serverBuilder.mountService(a(b(c)))