Hey there, this is probably a newbie question, but...
# ktor
b
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.
Copy code
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!
b
Both are extension functions rather than member
🙏 1
a
Here is the information about scope of extension functions.
🙏 1
b
i will read up on this! thanks so much for the info!