Hello, I am experimenting with the Ktor autoreload...
# ktor
n
Hello, I am experimenting with the Ktor autoreload feature. I specify my
module
as a function reference (not as a labmda), as instructed, and set the
watchPaths
to my projects directory. When I launch the server, it shows a bunch of
... DEBUG ktor.application - Watching ...
messages with all the paths that are in the specified directory. So I suspect, it initializes ok. However, when I change anything in any of these files, there's no reaction from Ktor, no reloading, and not even an error or debug message.
o
Do you compile the project after a change? It watches for class files, not source files.
n
@orangy Ah, I did not recompile. Thought it would pick it up automatically. Now I am trying to recompile and I am getting a
FileNotFoundException
for my static resources in the
out
directory, with the "access denied" notice.
I guess that that means that these files are in use
f
Ah so that is why I have had the reload on but nothing has been happening ever. I just press the recompile button in IntelliJ and then I can see the changes, works quite nice so i haven’t put much more time into it. But it would be nice to get something that works as good as the reload loop in Play framework. I used that prior to ktor, but I really wanted to try kotlin.
And now I will never switch back because kotlin is just the best experience I have ever had. It fits me perfectly
The only thing I am missing from Play is the hot reload.
n
Yeah, same here! I am so used to the instant responses of Play when on Scala and Figwheel when on Clojure! Restarting the server on each change is so tedious.. I wonder if it is possible to add this feature to Ktor on Kotlin too.
Btw, the recompilation that I am required to initiate manually, takes a rather long time in comparison to what we have in those frameworks.