Skip to content
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
3 changes: 0 additions & 3 deletions .deder/server.properties

This file was deleted.

47 changes: 31 additions & 16 deletions deder.pkl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
amends "https://sake92.github.io/deder/config/DederProject.pkl"
amends "https://sake92.github.io/deder/config/v0.2.3/DederProject.pkl"

local const function pomSettings(
_artifactId: String,
Expand Down Expand Up @@ -172,12 +172,6 @@ local const sharafCoreModules =
testTemplate = (sharafCoreTemplate.asTest()) {
deps { "org.scalameta::munit::1.1.0" }
}
jsTemplate = (sharafCoreTemplate.asJs()) {
scalaJsVersion = versions.scalaJsVersion
}
jsTestTemplate = (jsTemplate.asTest()) {
deps { "org.scalameta::munit::1.1.0" }
}
nativeTemplate = (sharafCoreTemplate.asNative()) {
scalaNativeVersion = versions.scalaNativeVersion
moduleDeps {
Expand Down Expand Up @@ -228,19 +222,36 @@ local const sharafUndertowModules =
}.get

local const sharafHttp4sModules =
new CreateScalaModules {
new CreateCrossModules {
root = "sharaf-http4s"
local const _pomSettings =
pomSettings("sharaf-http4s", "Sharaf Http4s", "Sharaf integration with Http4s")
template = (baseTemplate) {
pomSettings = pomSettings("sharaf-http4s", "Sharaf Http4s", "Sharaf integration with Http4s")
moduleDeps {
sharafCoreModules.jvm
}
deps { "org.http4s::http4s-server::0.23.32" }
pomSettings = _pomSettings
moduleDeps { sharafCoreModules.jvm }
deps { "org.http4s::http4s-server::0.23.34" }
}
testTemplate = (baseTemplate.asTest()) {
deps {
"org.scalameta::munit::1.1.0"
"org.http4s::http4s-client::0.23.32"
"org.http4s::http4s-client::0.23.34"
}
}
nativeTemplate = (baseTemplate.asNative()) {
scalaNativeVersion = versions.scalaNativeVersion
pomSettings = _pomSettings
moduleDeps { sharafCoreModules.native }
deps {
"org.http4s::http4s-server::0.23.34"
"com.lihaoyi::sourcecode::0.4.2"
"io.github.cquiroz::scala-java-time::2.6.0"
}
}
nativeTestTemplate = (nativeTemplate.asTest()) {
multithreading = true
deps {
"org.scalameta::munit::1.1.0"
"org.http4s::http4s-client::0.23.34"
}
}
}.get
Expand Down Expand Up @@ -403,7 +414,7 @@ local const http4sExampleModules =
new CreateScalaModules {
root = "examples/http4s"
template = (baseExampleTemplate) {
moduleDeps { sharafHttp4sModules.main }
moduleDeps { sharafHttp4sModules.jvm }
deps { "org.http4s::http4s-ember-server::0.23.32" }
}
testTemplate = (baseExampleTemplate.asTest()) {
Expand All @@ -425,7 +436,10 @@ modules {
sharafCoreModules.native
sharafCoreModules.native_test
...sharafUndertowModules.all
...sharafHttp4sModules.all
sharafHttp4sModules.jvm
sharafHttp4sModules.jvm_test
sharafHttp4sModules.native
sharafHttp4sModules.native_test
...sharafHelidonModules.all
...sharafJdkHttpserverModules.all
sharafSnunit
Expand All @@ -438,3 +452,4 @@ modules {
...snunitExampleModules.all
...http4sExampleModules.all
}

1 change: 0 additions & 1 deletion examples/api/test/src/JsonApiSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class JsonApiSuite extends munit.FunSuite {
}

// filtering GET
// TODO reenable
locally {
val queryParams = ProductsQuery(Set("Chocolate"), Option(1)).toSttpQuery()
val res = quickRequest.get(uri"$baseUrl/products".withParams(queryParams)).send()
Expand Down
12 changes: 8 additions & 4 deletions sharaf-http4s/src/ba/sake/sharaf/http4s/SharafHttpApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ def SharafHttpApp(sharafHandler: SharafHandler) =
Seq.empty // TODO: remove header
}))

body <- IO.pure(response.body match {
body <- response.body match {
case Some(body) =>
fs2.io.readOutputStream(4096)(outputStream => IO.blocking(response.rw.write(body, outputStream)))
IO.blocking {
val baos = new java.io.ByteArrayOutputStream()
response.rw.write(body, baos)
fs2.Stream.emits[IO, Byte](baos.toByteArray())
}
case None =>
fs2.Stream.empty[IO]
})
IO.pure(fs2.Stream.empty[IO])
}

response <- IO.pure(
Http4sResponse[IO](
Expand Down
Loading