You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi -- Is it possible to update a route after the server is running?
If I begin with:
app = Morsel.app()
get(app, "/test") do req, res
"Original"
end
@async start(app, 8000)
And then later on in the repl session:
get(app, "/test") do req, res
"Updatedl"
end
Getting /test always returns Original
Fyi, having the route handler call a global function and updating the global function in the repl works just fine e.g.
foo(req,res) = "bar"
get(app, "/test") do req, res
foo(req,res)
end
##later
foo(req,res) = "baz"
Also adding completely different routes after the server is started works fine as well -- perhaps there is some tweaking needed in the route tree logic?
thanks!
The text was updated successfully, but these errors were encountered:
Hi -- Is it possible to update a route after the server is running?
If I begin with:
And then later on in the repl session:
Getting
/test
always returnsOriginal
Fyi, having the route handler call a global function and updating the global function in the repl works just fine e.g.
Also adding completely different routes after the server is started works fine as well -- perhaps there is some tweaking needed in the route tree logic?
thanks!
The text was updated successfully, but these errors were encountered: