Added handlers to config

This commit is contained in:
Sdogruyol 2015-11-12 22:48:22 +02:00
parent cd0e77aacc
commit fb1d3c3a85
2 changed files with 14 additions and 5 deletions

View file

@ -9,11 +9,10 @@ at_exit do
end
config = Kemal.config
handlers = [] of HTTP::Handler
handlers << HTTP::LogHandler.new
handlers << Kemal::Handler::INSTANCE
handlers << HTTP::StaticFileHandler.new("./public")
server = HTTP::Server.new(config.port, handlers)
config.add_handler HTTP::LogHandler.new
config.add_handler Kemal::Handler::INSTANCE
config.add_handler HTTP::StaticFileHandler.new("./public")
server = HTTP::Server.new(config.port, config.handlers)
server.ssl = config.ssl