Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netty backend #200

Merged
merged 6 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion nio-server/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ organization := "fr.maif"

lazy val `nio-server` = (project in file("."))
.enablePlugins(PlayScala, DockerPlugin)
.disablePlugins(PlayPekkoHttpServer)
.enablePlugins(NoPublish)
.disablePlugins(BintrayPlugin)

scalaVersion := Dependencies._scalaVersion

PlayKeys.devSettings += "play.server.provider" -> "play.core.server.NettyServerProvider"

resolvers ++= Seq(
Resolver.jcenterRepo,
"Maven central" at "https://repo1.maven.org/maven2/"
Expand All @@ -25,6 +28,7 @@ ThisBuild / scalafixDependencies ++= Seq("org.reactivemongo" %% "reactivemongo-

libraryDependencies ++= Seq(
ws,
nettyServer,
"org.apache.pekko" %% "pekko-stream" % pekko,
"org.apache.pekko" %% "pekko-actor-typed" % pekko,
"org.apache.pekko" %% "pekko-slf4j" % pekko,
Expand All @@ -40,7 +44,6 @@ libraryDependencies ++= Seq(
"org.apache.commons" % "commons-lang3" % "3.11",
"de.svenkubiak" % "jBCrypt" % "0.4.1", // ISC/BSD
"com.auth0" % "java-jwt" % javaJwt, // MIT license
// "com.github.pureconfig" %% "pureconfig" % pureConfig, // Apache 2.0
"com.github.pureconfig" %% "pureconfig-core" % pureConfig, // Apache 2.0
"com.github.pureconfig" %% "pureconfig-generic-scala3" % pureConfig, // Apache 2.0
"org.scalactic" %% "scalactic" % scalaticVersion, // Apache 2.0
Expand Down Expand Up @@ -80,6 +83,7 @@ assembly / assemblyMergeStrategy := {
case PathList(xs @ _*) if xs.lastOption.contains("mime.types") => MergeStrategy.first
case PathList(ps @ _*) if ps.last == "io.netty.versions.properties" => MergeStrategy.first
case PathList(ps @ _*) if ps.contains("reference-overrides.conf") => MergeStrategy.concat
case PathList(ps @ _*) if ps.contains("reflect-config.json") => MergeStrategy.first
case PathList(ps @ _*) if ps.contains("native-image.properties") => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith ".conf" => MergeStrategy.concat
case PathList(ps @ _*) if ps.contains("buildinfo") => MergeStrategy.discard
Expand Down
2 changes: 2 additions & 0 deletions nio-server/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ play.application.loader = loader.NioLoader
// add filter NioFilter
play.modules.enabled += "play.modules.reactivemongo.ReactiveMongoModule"

play.server.provider = play.core.server.NettyServerProvider

play {
filters {
enabled += filters.OtoroshiFilter
Expand Down
2 changes: 1 addition & 1 deletion nio-server/test/controllers/HomeControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class HomeControllerSpec extends TestUtils {
callJson(s"/$tenant/bo", GET, api = false)

response.status must be(OK)
response.contentType must be("text/html; charset=UTF-8")
response.contentType.toLowerCase must be("text/html; charset=utf-8")
}

}
Expand Down
2 changes: 1 addition & 1 deletion nio-server/test/controllers/TenantControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TenantControllerSpec extends TestUtils {
postXml(path, tenantXml, headers = Seq(CONTENT_TYPE -> XML, secret))

resp.status mustBe CREATED
resp.contentType mustBe s"$XML; charset=UTF-8"
resp.contentType.toLowerCase mustBe s"$XML; charset=utf-8"
}

"create with content-type json" in {
Expand Down
Loading