kotlin - How can we use automatic reloading? -


trying utilise automatic module reloading feature (as described here), documentation unfortunately not helpful.

it says use configuration, configuration page empty.

i believe can pass in "watch" list of modules embeddedserver() call this page, when do, following exception: module function provided lambda cannot unlinked reload.

so won't let pass in lambda application module, i'm not sure how avoid doing while getting access application methods (e.g. routing()).

has been able automatic reloading working lately? if so, how?

lambda might have captured state containing function , cannot reloaded – there no way restore captured state. have extract application separate function this:

fun application.module() {    install(calllogging)    install(routing) {       get("/") {         call.respondtext("""hello, world!<br><a href="/bye">say bye?</a>""", contenttype.text.html)       }     …    } } 

and start function reference:

embeddedserver(jetty, watchpaths = listof("embedded"), module = application::module).start() 

Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -