Skip to content

Instantly share code, notes, and snippets.

@adamw
Created May 18, 2020 08:11
Show Gist options
  • Save adamw/28d17aac66462cbb1a7ed34ad85c7526 to your computer and use it in GitHub Desktop.
Save adamw/28d17aac66462cbb1a7ed34ad85c7526 to your computer and use it in GitHub Desktop.
// the endpoints are interpreted as an http4s.HttpRoutes[IO]
import sttp.tapir.server.http4s._
import org.http4s.HttpRoutes
implicit val ec: ExecutionContext = scala.concurrent.ExecutionContext.Implicits.global
implicit val contextShift: ContextShift[IO] = IO.contextShift(ec)
implicit val timer: Timer[IO] = IO.timer(ec)
val routes: HttpRoutes[IO] = List(getPetWithLogic, addPetWithLogic).toRoutes
// expose routes using http4s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment