https://kotlinlang.org logo
Title
s

Shalaga44

09/05/2020, 1:57 PM
Hi, I'm newbie trying to use KMP to build a full stack web app using Ktor in jvmMain as back-end and Kotlin-React in jsMain as front-end, How can I add all jsMain source set to ktor watch path to enable automatic reload .
fun main() {
    embeddedServer(
        Netty, watchPaths = listOf("jvmMain"), port = 8080,
        module = Application::myModule
    ).start(wait = true)
}
fun Application.myModule() {
    routing {
        get("/") {
            call.respondHtml(HttpStatusCode.OK, HTML::index)
        }
        static("/static") {
            resources()
        }
    }
}
This does exactly that
😍 1