Hey there, this is probably a newbie question, but since it’s related to ktor:
To get this code below working…why do I have to import
both io.ktor.server.application.call
and
io.ktor.server.response.respondText
? What is it about the
call
property that requires both imports?
I would have thought just importing
io.ktor.server.application.call
is enough. Then calling
call.respondText()
is ok, but I get an Unresolved Reference error if I dont include the other import.
package com.mobilecoin.plugins
import io.ktor.server.application.Application
import io.ktor.server.application.call
import io.ktor.server.response.respondText
import io.ktor.server.routing.get
import io.ktor.server.routing.routing
fun Application.configureRouting() {
// Starting point for a Ktor app:
routing {
get("/") {
call.respondText("Hello World!")
}
}
routing {
}
}
Thanks!