Hi, maybe a stupid question, but I want to serve c...
# ktor
m
Hi, maybe a stupid question, but I want to serve compose-web from ktor, but I’m unsure how to reference the js+html files in ktor. I have multi project setup in gradle
b
Follow the config here, it does exactly what you want (with gradle integration and all the other goodies) https://github.com/mpetuska/kamp/blob/kodex/app/server/src/jvmMain/kotlin/config/routing.kt#L73
m
this is awesome, thanks!
so it boils down to
Copy code
into("WEB-INF") {
      from(jsBrowserDistribution)
      exclude("**/*.scss")
    }
and then adding it as static content in ktor
b
Pretty much, but also hooking up task dependencies accross the modules. My setup also supports hosting webapp as both, embedded within ktor as well as standalone.
In short CfW is no different from any other static js webapp (e.g. react) - it's just a bunch of js, html and css in the end