Genie Discord forum
I've been doing a bunch of dev on a Genie backend. It's pretty simple stuff, just a bunch of
route calls and some backend logic.
Is there a way to reload the server without killing my Julia session? Or to have it monitor the backend code/routes for changes?
Genie uses Revise.jl to handle code reloading. For instance, if you're including your routes with an
includestatement, hotreloading won't work.
Can you share a MWE where reloading doesn't work and I'll help you out?
Ah, so I need to just wrap my code in modules?
You can manually set Revise to reload code, or call Genie.autoload to watch some files. Moreover, if you define your routes in the routes.jl file in the root, any changes made to it will be automatically reloaded. The routes.jl file is one of the ones automatically watched when launching a Genie app. Note that routes.jl should not be enclosed in a module.