Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active February 3, 2026 20:21
Show Gist options
  • Select an option

  • Save dacr/66d1ed08411d93e677fd5c94de999768 to your computer and use it in GitHub Desktop.

Select an option

Save dacr/66d1ed08411d93e677fd5c94de999768 to your computer and use it in GitHub Desktop.
tapir with pekko http / published by https://github.com/dacr/code-examples-manager #2f3b6ce0-298d-4863-aa6a-753ee40829d2/94127c41139d080515f14bc5ced9b5461394ddad
// summary : tapir with pekko http
// keywords : scala, pekko, tapir, @testable, @exclusive
// publish : gist
// authors : David Crosson
// license : Apache License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
// id : 2f3b6ce0-298d-4863-aa6a-753ee40829d2
// created-on : 2025-02-14T21:51:30+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
// test-with : curl -L http://127.0.0.1:8080/hello/david
// ---------------------
//> using scala 3.6.3
//> using dep com.softwaremill.sttp.tapir::tapir-pekko-http-server:1.11.14
//> using dep com.softwaremill.sttp.tapir::tapir-jsoniter-scala:1.11.14
// ---------------------
import sttp.tapir.*
import sttp.tapir.server.pekkohttp.PekkoHttpServerInterpreter
import scala.concurrent.Future
import org.apache.pekko.http.scaladsl.server.Route
import scala.concurrent.ExecutionContext.Implicits.global
val helloEndPoint = endpoint.in("hello").out(stringBody)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment