Allow 404 error handler to be customizable

This commit is contained in:
Sdogruyol 2016-05-15 14:58:09 +03:00
parent 92d7273759
commit 67abb5fff3
3 changed files with 9 additions and 8 deletions

View file

@ -12,8 +12,10 @@ module Kemal
config.server = HTTP::Server.new(config.host_binding.not_nil!, config.port, config.handlers)
config.server.not_nil!.ssl = config.ssl
error 404 do |env|
render_404(env)
unless Kemal.config.error_handlers.has_key?(404)
error 404 do |env|
render_404
end
end
# Test environment doesn't need to have signal trap, built-in images, and logging.