Start implementing error block

This commit is contained in:
sdogruyol 2016-05-05 22:35:36 +03:00
parent 35239dfaa0
commit e6d9311895
7 changed files with 71 additions and 25 deletions

View file

@ -2,7 +2,6 @@ require "./kemal/*"
require "./kemal/middleware/*"
module Kemal
# The command to run a `Kemal` application.
def self.run
Kemal::CLI.new
@ -13,6 +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)
end
# Test environment doesn't need to have signal trap, built-in images, and logging.
unless config.env == "test"
Signal::INT.trap {