https://kotlinlang.org logo
#ktor
Title
# ktor
a

Alexander Suraphel

01/15/2022, 2:11 PM
I just created a project with Ktor but my changes are not auto reloading unless I rerun the app on IntelliJ. Is there auto-reload out of the box?
b

Big Chungus

01/15/2022, 2:25 PM
Auto reload only happens when you recompile your kt files as it's only reloading .class files. You need a separate continuous kotlin compilation running in the background
a

Alexander Suraphel

01/15/2022, 2:25 PM
Is there a way to enable that on IntelliJ? The continuous compilation?
b

Big Chungus

01/15/2022, 2:26 PM
No, it's gradle feature (google around)
a

Alexander Suraphel

01/15/2022, 2:26 PM
okay thank s
r

Rescribet

01/15/2022, 3:39 PM
Note that development mode needs to be on for this. Keeping with 12 factor and wanting to use
application.conf
without separate files for different envs, removing the development line from that conf and adding the following worked well:
Copy code
application {
    mainClass.set("io.ktor.server.cio.EngineMain")

    if (System.getenv("KTOR_ENV") == "development") {
        applicationDefaultJvmArgs = listOf("-Dio.ktor.development=true")
    }
}
🙏 1
a

Alexander Suraphel

01/15/2022, 5:18 PM
Thanks @Rescribet
3 Views