mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	More docs
This commit is contained in:
		
							parent
							
								
									8aab44f7cd
								
							
						
					
					
						commit
						d11b702ee4
					
				
					 4 changed files with 12 additions and 3 deletions
				
			
		|  | @ -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 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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 | ||||||
|  |  | ||||||
|  | @ -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 | ||||||
|  |  | ||||||
|  | @ -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) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue