Skip to content

Instantly share code, notes, and snippets.

@calippo
Created January 14, 2020 09:17
Show Gist options
  • Save calippo/69a0f222afbb6ca35ab5104f6f1f83d5 to your computer and use it in GitHub Desktop.
Save calippo/69a0f222afbb6ca35ab5104f6f1f83d5 to your computer and use it in GitHub Desktop.
tapiro http4s
object ControllerHttp4sEndpoints {
def routes(controller: Controller[F])(
implicit ...
): HttpRoutes[F] = {
val endpoints = ControllerEndpoints.create()
val getContainers =
endpoints.getSomething.toRoutes((controller.getSomething _).tupled)
val getContainerStatus = endpoints.doSomething.toRoutes(controller.doSomething)
)
NonEmptyList(
getContainers,
List(
getContainerStatus
)
).reduceK
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment