Skip to content

Instantly share code, notes, and snippets.

@dacr
Created December 15, 2025 17:29
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/34000e06537782ae4972156d40bfaf1005da20e9
// summary : tapir with pekko http
// keywords : scala, pekko, tapir, @testable, @exclusive
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// 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