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.

Revisions

  1. dacr revised this gist Feb 3, 2026. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tapir-pekko-http.sc
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    // 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)
    // 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
  2. dacr created this gist Dec 15, 2025.
    24 changes: 24 additions & 0 deletions tapir-pekko-http.sc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    // 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)