kasper.kondzielski
11/21/2018, 8:49 PMval client = HttpClient()
install(ContentNegotiation) {
jackson {
enable(SerializationFeature.INDENT_OUTPUT)
}
}
runBlocking {
val buildLog = client.get<HttpResponse>("<https://jitpack.io/com/github/ghostbuster91/gh-webhook-test/f82f1363432678ab9bf4bab325b7af3a78460d35/>")
println("start")
println(buildLog.readText())
}
and after invoking it buildLog.readText
is emptyaridder
11/21/2018, 9:03 PMNo ktor.deployment.watch patterns match classpath entries, automatic reload is not active
I use OpenJDK 1.8
This works, but not watching the directories i want:
watchPaths = listOf("bystativ-server-gradle/")
It only watches the bystativ-server-gradle/out directory and its subfolders. I want it to watch the bystativ-server-gradle/src directorykodal
11/22/2018, 2:42 PMBernhard
11/22/2018, 8:02 PMjvassbo
11/23/2018, 12:37 PMtipsy
11/24/2018, 12:02 PMv
11/25/2018, 2:28 PMrepositories {
jcenter()
mavenCentral()
}
dependencies {
...
compile "io.ktor:ktor-client-json:$ktor_version"
compile "io.ktor:ktor-client-gson:$ktor_version"
}
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:0.9.0.
Searched in the following locations:
- <https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-serialization-runtime-common/0.9.0/kotlinx-serialization-runtime-common-0.9.0.pom>
- <https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-serialization-runtime-common/0.9.0/kotlinx-serialization-runtime-common-0.9.0.jar>
- <https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-serialization-runtime-common/0.9.0/kotlinx-serialization-runtime-common-0.9.0.pom>
- <https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-serialization-runtime-common/0.9.0/kotlinx-serialization-runtime-common-0.9.0.jar>
Required by:
project : > io.ktor:ktor-client-json:1.0.0
> Could not find org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.9.0.
Searched in the following locations:
- <https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-serialization-runtime/0.9.0/kotlinx-serialization-runtime-0.9.0.pom>
- <https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-serialization-runtime/0.9.0/kotlinx-serialization-runtime-0.9.0.jar>
- <https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-serialization-runtime/0.9.0/kotlinx-serialization-runtime-0.9.0.pom>
- <https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-serialization-runtime/0.9.0/kotlinx-serialization-runtime-0.9.0.jar>
Required by:
project : > io.ktor:ktor-client-gson:1.0.0 > io.ktor:ktor-client-json-jvm:1.0.0
v
11/25/2018, 8:28 PM/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin/java ...
Error occurred during initialization of boot layer
java.lang.module.ResolutionException: Modules ktor.server.core and ktor.utils.jvm export package io.ktor.util to module io.netty.codec.http2
Sergey Shnifer
11/26/2018, 2:11 PMRiccardo Montagnin
11/26/2018, 2:19 PMmp
11/26/2018, 3:54 PMHamza
11/27/2018, 9:31 AMstatic("public") {
staticRootFolder = File(Server::class.java.classLoader.getResource("static").file)
resources("styles")
resources("js")
}
while my css file is in resources/static/styles/master.css, when i go to localhost:7000/public/styles/master.css
i receive a 404gaetan
11/27/2018, 2:13 PMmp
11/27/2018, 4:54 PMgabin
11/27/2018, 6:39 PMrharter
11/27/2018, 8:41 PMEduard Boloș
11/27/2018, 10:47 PMstatic("assets") {
staticRootFolder = File("public")
files("static")
}
The problem is that files are not resolved correctly. For instance, when I call /assets/static/file.txt on the server, I can see while debugging that in StaticContent.kt#L86
, the file is resolved to public/static/static/file.txt
instead of public/static/file.txt
as I would expect. Pretty much the folder name is duplicated. Any idea what might be wrong, or wether this could be a bug in Ktor?Alice
11/28/2018, 4:34 AM@Test
fun `can register user and get jwt`() = withApplication {
main()
val newUser = NewUser("someusername", "someemail", "Tr0ub4dor83")
val req = handleRequest(<http://HttpMethod.Post|HttpMethod.Post>, "/api/users/register") {
setBody(
Gson().toJson(newUser)
)
}
println(req.response.status().toString())
println(req.response.headers)
println(req.response.content)
val token = req.response.headers["Authorization"]
println(token)
}
am I doing something wrong without realizing?gaetan
11/28/2018, 12:59 PMfun main(args: Array<String>) {
embeddedServer(
factory = Netty,
port = 8080
) {
proxyAndCache()
mainModule()
}.start(wait = true)
}
When I launch this code from my Idea Kotlin run configuration, the proxyAndCache
function is called . But when I launch the code from gradle the function is not called.gaetan
11/28/2018, 1:03 PMmain
to launch ktor.ctierney
11/28/2018, 8:24 PMwithTestApplication
block is at a higher level. It would be nice to be able to create the TestEngine once (e.g. at the given("an application")
level) and use it in multiple on
/ it
contexts.gotoOla
11/29/2018, 1:11 PM// Type of job here is Deffered<String>
val job = async {
"kanelbulle"
}
// The await will give you the value
println(job.await())
the await is “blocking” in terms of how your code is sequentially running but it doesn’t actually block threads as the await is a suspension pointorangy
11/30/2018, 6:07 AMirus
11/30/2018, 1:30 PMkotlinx-serialization
in ktor-client-jackson
?toomanyeduardos
11/30/2018, 10:27 PMpabl0rg
12/01/2018, 3:38 AMSoundlicious
12/01/2018, 1:53 PMAlice
12/02/2018, 2:38 AMjkbbwr
12/02/2018, 5:02 AMCaused by: kotlinx.serialization.SerializationException: Can't locate argument-less serializer for class io.ktor.client.features.websocket.ClientWebSocketSession. For generic classes, such as lists, please provide serializer explicitly.
at kotlinx.serialization.PlatformUtilsKt.serializer(PlatformUtils.kt:28)
at io.ktor.client.features.json.serializer.KotlinxSerializer.lookupSerializer(KotlinxSerializer.kt:64)
at io.ktor.client.features.json.serializer.KotlinxSerializer.read(KotlinxSerializer.kt:55)
at io.ktor.client.features.json.JsonFeature$Feature$install$2.invokeSuspend(JsonFeature.kt:64)
at io.ktor.client.features.json.JsonFeature$Feature$install$2.invoke(JsonFeature.kt)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:248)
... 31 more
dave08
12/02/2018, 7:20 AMdave08
12/02/2018, 7:20 AMkenkyee
12/02/2018, 1:24 PMdave08
12/02/2018, 2:08 PMkenkyee
12/02/2018, 2:22 PMFrancois Stiennon
12/16/2020, 10:45 AMkenkyee
12/16/2020, 11:39 AM