diff --git a/scala/pekkohttp/.gitignore b/scala/pekkohttp/.gitignore new file mode 100644 index 00000000000..a4cca675558 --- /dev/null +++ b/scala/pekkohttp/.gitignore @@ -0,0 +1,3 @@ +project/project +project/target +target/ \ No newline at end of file diff --git a/scala/pekkohttp/build.sbt b/scala/pekkohttp/build.sbt new file mode 100644 index 00000000000..283b946df08 --- /dev/null +++ b/scala/pekkohttp/build.sbt @@ -0,0 +1,11 @@ +name := "server" +scalaVersion := "3.5.2" + +val PekkoVersion = "1.1.0" +val PekkoHttpVersion = "[1.1,1.2]" +libraryDependencies ++= Seq( + "org.apache.pekko" %% "pekko-actor-typed" % PekkoVersion, + "org.apache.pekko" %% "pekko-stream" % PekkoVersion, + "org.apache.pekko" %% "pekko-http" % PekkoHttpVersion +) +enablePlugins(JavaAppPackaging) diff --git a/scala/pekkohttp/config.yaml b/scala/pekkohttp/config.yaml new file mode 100644 index 00000000000..5f51d4f4971 --- /dev/null +++ b/scala/pekkohttp/config.yaml @@ -0,0 +1,3 @@ +framework: + website: pekko.apache.org + version: 1.1 diff --git a/scala/pekkohttp/project/plugins.sbt b/scala/pekkohttp/project/plugins.sbt new file mode 100644 index 00000000000..5c751f096f8 --- /dev/null +++ b/scala/pekkohttp/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "latest.integration") diff --git a/scala/pekkohttp/src/main/scala/Main.scala b/scala/pekkohttp/src/main/scala/Main.scala new file mode 100644 index 00000000000..812996f6144 --- /dev/null +++ b/scala/pekkohttp/src/main/scala/Main.scala @@ -0,0 +1,25 @@ +import org.apache.pekko +import pekko.actor.ActorSystem +import pekko.http.scaladsl.Http +import pekko.http.scaladsl.server.Directives._ + +object Main { + def main(args: Array[String]): Unit = { + implicit val system = ActorSystem("PekkoHttp") + + val route = + pathSingleSlash { + complete("") + } ~ + path("user") { + post { + complete("") + } + } ~ + path("user" / Remaining) { id => + complete(id) + } + + Http().bindAndHandle(route, "0.0.0.0", 3000) + } +} \ No newline at end of file