More docs

This commit is contained in:
Sdogruyol 2016-07-17 14:26:22 +03:00
parent 8aab44f7cd
commit d11b702ee4
4 changed files with 12 additions and 3 deletions

View File

@ -1,4 +1,5 @@
module Kemal
# Kemal::CommonExceptionHandler handles all the exceptions including 404, custom errors and 500.
class CommonExceptionHandler < HTTP::Handler
INSTANCE = new

View File

@ -1,4 +1,9 @@
module Kemal
# Kemal::Config stores all the configuration options for a Kemal application.
# It's a singleton and you can access it like.
#
# Kemal.config
#
class Config
INSTANCE = Config.new
HANDLERS = [] of HTTP::Handler

View File

@ -1,8 +1,10 @@
# Context is the environment which holds request/response specific
# information such as params, content_type e.g
# HTTP::Server::Context is the class which holds HTTP::Request and HTTP::Server::Response alongside with
# information such as request params, request/response content_type, session e.g
#
# Instances of this class are passed to an `HTTP::Server` handler.
class HTTP::Server
class Context
alias StoreTypes = Nil | String | Int32 | Float64 | Bool
alias StoreTypes = Nil | String | Int32 | Float64 | Bool
getter store = {} of String => StoreTypes
def params

View File

@ -1,3 +1,4 @@
# Exceptions for 404 and custom errors are defined here.
module Kemal::Exceptions
class RouteNotFound < Exception
def initialize(context)