Hamza
12/02/2018, 9:14 AM2018-12-02 16:14:17.012 [nettyWorkerPool-3-1] INFO Application - Changes in application detected.
but then it never gives any content on any port againAdam Hurwitz
12/02/2018, 7:30 PMTsvetozar Bonev
12/03/2018, 2:01 PMrouting {
route("/route", endpoints())
}
or any other way to move all of the posts, deletes etc. out of this file and into something else.gotoOla
12/03/2018, 4:34 PMgotoOla
12/04/2018, 12:17 PMgotoOla
12/04/2018, 1:11 PMCaused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.handler.ContextHandler$NoContext
Has anyone experience the same thing with ktor+JettyEngine?kevin.cianfarini
12/04/2018, 7:40 PMchadmorrow
12/04/2018, 11:58 PMjasoet
12/05/2018, 1:08 AMgcole
12/06/2018, 3:12 AMktor {
deployment {
environment = development
port = 8080
autoreload = true
watch = [ org/grcole/bfw ]
}
application {
modules = [ org.grcole.bfw.BFWApplicationKt.main ]
}
}
but when I run it, it tells me there are no watched locations:
[grcole@C02WP0CRHTDG bfw (master)]$ ./gradlew :run
> Task :run
2018-12-05 19:04:49.865 [main] INFO Application - No ktor.deployment.watch patterns match classpath entries, automatic reload is not active
2018-12-05 19:04:50.295 [main] INFO Application - Responding at <http://0.0.0.0:8080>
Is there a 'best practice link' for env setup for a noob?avolkmann
12/06/2018, 6:15 AMgaetan
12/06/2018, 7:52 AMlegzo
12/06/2018, 11:57 AMclient.get<Either<ResponseObject, ErrorObject>>() {}
gotoOla
12/06/2018, 12:47 PMbjonnh
12/06/2018, 7:16 PMmantono
12/07/2018, 4:21 PMauthenticate("auth1", "auth2")
is used. So if I change to authenticate("auth2", "auth1")
then basic auth works but not the other way around.frellan
12/08/2018, 10:49 PMFile
so I can process it with a DOM parser? I guess I readBytes and then do something but I don’t really know, surely download an xml file must be something quite standard.jkbbwr
12/10/2018, 5:44 AMjkbbwr
12/10/2018, 8:21 AMException in thread "DefaultDispatcher-worker-3" kotlinx.io.charsets.MalformedInputException: Input length = 1
adeln
12/10/2018, 11:19 AMktor
backend? E.g. which endpoints get called the most, from which countries, which browsers etc?kagomez
12/11/2018, 10:09 PMcoder82
12/12/2018, 7:51 AMmantono
12/12/2018, 8:47 AMjkbbwr
12/12/2018, 11:12 AMcmgurba
12/12/2018, 9:12 PMktor Content-Type need to be passed in OutgoingContent.contentType
. Anybody have links to OutgoingContent documentation and how I can configure it at instantiation?Marc Knaup
12/13/2018, 3:46 PMpipeline.sendPipeline.intercept(ApplicationSendPipeline.Render) { subject ->
if (subject is OutgoingContent) return@intercept
launch(context = <http://Dispatchers.IO|Dispatchers.IO>) {
proceedWith(feature.process(subject))
}
}
Lucas
12/14/2018, 4:19 AMfun Application.module(database: Database, channel: Channel<String>) {
routing {
webSocket("/") {
while (true) {
val payload = incoming.receive() as Frame.Text
val event = payload.readText()
database.save(event)
channel.send(event)
}
}
}
}
For some reason the test below does not finish and produces a INFO log entry:
val database = mockk<Database>()
val channel = Channel<String>()
val event = "John's birthday"
withTestApplication({ module(database, channel) }) {
runBlocking {
launch {
handleWebSocket("/") {
setBody(event)
}
}
delay(300)
expectThat(channel.count()).isEqualTo(1)
coVerify(exactly = 1) { database.save(event) }
}
}
2018-12-14 02:13:46.002 [DefaultDispatcher-worker-1 @coroutine#3] INFO ktor.test - 101 Switching Protocols: GET - /
When running in production the code works as expected, so I may be missing something in the test case. The Kotlin version is 1.3.10 and Ktor version is 1.0.0.fcosta
12/17/2018, 12:33 AMUnsupportedMediaTypeException
when try to parse the body. Do you know what i’m doing wrong? I just followed the documentation: <https://ktor.io/servers/calls/requests.html#typed-objects>
fun main() {
embeddedServer(Netty, port = 8080, watchPaths = listOf(""), module = Application::module).start()
}
fun Application.module() {
install(StatusPages) {
exception<Throwable> {
call.respondText(it.localizedMessage, ContentType.Text.Plain, HttpStatusCode.InternalServerError)
}
}
install(ContentNegotiation) {
gson()
}
routing {
get("/") {
call.respondText("Hello World", ContentType.Text.Html)
}
post("/verify") {
val request = call.receive<Request>()
call.respond(request)
}
}
}
data class Request(val userId: String, val productId: String)
data class Response(val status: String)
hdarritchon
12/17/2018, 3:23 PMAlbert
12/18/2018, 1:38 PM1.0.1
val client = HttpClient(Apache)
the HttpClient
lights up red in IntelliJ, without a description what is going on. Anyone else experienced this?
It compiles fine and I can execute it.