Hi, I'm new to Kotlin and Ktor and i'd like this b...
# ktor
f
Hi, I'm new to Kotlin and Ktor and i'd like this basic function to run but I can't find where the issue is:
Copy code
package com.example

import io.ktor.server.engine.embeddedServer
import io.ktor.server.netty.Netty
import io.ktor.routing.*

fun main() {
    embeddedServer(Netty, port = 8080){ }.start()
    routing {
        get("/") {
            call.respondText("Hello, world!", ContentType.Text.Html)
        }
    }
}
The issue i'm getting is, the routing package cannot be imported. Any assistance will be greatly appreciated.
m
take a look at quick guides on ktor site: https://ktor.io/quickstart/guides/application.html You cannot configure routing over… no object like you do 🙂 it has to be on an application module
f
thank you @Matteo Mirk. my routing function should have been inside the embedded server function
👍 1