zero_coding
08/28/2020, 12:06 PMktor {
deployment {
port = 8080
port = ${?PORT}
watch = [ user-svc ]
}
application {
modules = [ io.databaker.ApplicationKt.module ]
}
}
Nikky
08/30/2020, 11:54 AMsrc
on a bad screenfun runKtor() {
val server = embeddedServer(
factory = Netty,
port = System.getenv("PORT")?.toIntOrNull() ?: 8080,
host = System.getenv("HOST") ?: "127.0.0.1",
watchPaths = listOf("jvm/main"),
module = Application::application,
configure = {
}
).start(false)
Runtime.getRuntime().addShutdownHook(Thread {
server.stop(1, 5, TimeUnit.SECONDS)
})
Thread.currentThread().join()
}
this also handles shutdown gracefully~/projects/projectName/build/classes/kotlin/jvm/main
which is why i just match on jvm/main
and it works well