Kemal::Config
Inherits Reference < Object
Stores all the configuration options for a Kemal application. It's a singleton and you can access it like.
Kemal.config
Constants
CUSTOM_HANDLERS = [] of Tuple(Int32 | ::Nil, HTTP::Handler)
ERROR_HANDLERS = {} of Int32 => (HTTP::Server::Context, Exception -> String)
EXCEPTION_HANDLERS = {} of Exception.class => (HTTP::Server::Context, Exception -> String)
FILTER_HANDLERS = [] of HTTP::Handler
HANDLERS = [] of HTTP::Handler
INSTANCE = Config.new
Constructors
new
SourceInstance methods
add_error_handler(status_code : Int32, &handler : HTTP::Server::Context, Exception -> _)
Adds an error handler for the given HTTP status code
add_exception_handler(exception : Exception.class, &handler : HTTP::Server::Context, Exception -> _)
Adds an error handler for the given exception
add_filter_handler(handler : HTTP::Handler)
Sourceadd_handler(handler : HTTP::Handler, position : Int32)
Sourceadd_handler(handler : HTTP::Handler)
Sourcealways_rescue
Sourcealways_rescue=(always_rescue : Bool)
Sourceapp_name
Sourceapp_name=(app_name : String)
Sourceclear
Sourceenv
Sourceenv=(env : String)
Sourceextra_options
Sourceextra_options
Sourceextra_options=(extra_options : Nil | OptionParser -> _)
Sourcehandlers
Sourcehandlers=(handlers : Array(HTTP::Handler))
Sourcehost_binding
Sourcehost_binding=(host_binding : String)
Sourcelogging
Sourcelogging=(logging : Bool)
Sourcemax_request_body_size
Sourcemax_request_body_size=(max_request_body_size : Int32)
Sourcemax_route_cache_size
Sourcemax_route_cache_size=(max_route_cache_size : Int32)
Sourceport
Sourceport=(port : Int32)
Sourcepowered_by_header=(powered_by_header : Bool)
Sourcepowered_by_header?
Sourcepublic_folder
Sourcepublic_folder=(public_folder : String)
Sourcerunning
Sourcerunning=(running : Bool)
Sourcescheme
Sourceserve_static
Sourceserve_static=(serve_static : Bool | Hash(String, Bool))
Sourceserver
Sourceserver=(server : HTTP::Server | Nil)
Sourcesetup
Sourceshutdown_message
Sourceshutdown_message=(shutdown_message : Bool)
Sourcessl
Sourcessl=(ssl : Nil | OpenSSL::SSL::Context::Server)
Sourcestatic_headers
Sourcestatic_headers=(static_headers : HTTP::Server::Context, String, File::Info -> | Nil)
Source