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
This may just be expected behavior but I was caught pretty off guard when I realized that the before_all handler is actually just called directly before the routes rather than being the first in the handler chain
require"kemal"classCustomHandler < Kemal::Handlerdefcall(context)
puts"This is a custom handler"
call_next context
endend
before_all { puts"Before all handler" }
add_handler CustomHandler.new
get "/" { puts"route!" }
Kemal.run
Results in the following on a request
This is a custom handler
Before all handler
route!
It lead to some problems when I was working on a program under the assumption that the custom user handlers would be called after the before_all
The text was updated successfully, but these errors were encountered:
Description
This may just be expected behavior but I was caught pretty off guard when I realized that the
before_all
handler is actually just called directly before the routes rather than being the first in the handler chainResults in the following on a request
It lead to some problems when I was working on a program under the assumption that the custom user handlers would be called after the
before_all
The text was updated successfully, but these errors were encountered: