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 module Kemal
# Kemal::CommonExceptionHandler handles all the exceptions including 404, custom errors and 500.
class CommonExceptionHandler < HTTP::Handler class CommonExceptionHandler < HTTP::Handler
INSTANCE = new INSTANCE = new

View file

@ -1,4 +1,9 @@
module Kemal 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 class Config
INSTANCE = Config.new INSTANCE = Config.new
HANDLERS = [] of HTTP::Handler HANDLERS = [] of HTTP::Handler

View file

@ -1,8 +1,10 @@
# Context is the environment which holds request/response specific # HTTP::Server::Context is the class which holds HTTP::Request and HTTP::Server::Response alongside with
# information such as params, content_type e.g # 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 HTTP::Server
class Context class Context
alias StoreTypes = Nil | String | Int32 | Float64 | Bool alias StoreTypes = Nil | String | Int32 | Float64 | Bool
getter store = {} of String => StoreTypes getter store = {} of String => StoreTypes
def params def params

View file

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