Trying to utilise the automatic module reloading feature (as described here), but the documentation is unfortunately not too helpful.
It says to use configuration, but the configuration page is empty.
I believe you can pass in the "watch" list of modules into the embeddedServer()
call from this page, but when I do, I get the following exception: Module function provided as lambda cannot be unlinked for reload
.
So it won't let you pass in a lambda as an application module, but then I'm not sure how to avoid doing that while getting access to the Application
methods (e.g. routing()
).
Has anyone been able to get automatic reloading working lately? If so, how?
Lambda might have a captured state from containing function and thus cannot be reloaded – there is no way to restore the captured state. You have to extract application into a separate function like this:
And then start it with function reference: