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 | ||||
|   # Kemal::CommonExceptionHandler handles all the exceptions including 404, custom errors and 500. | ||||
|   class CommonExceptionHandler < HTTP::Handler | ||||
|     INSTANCE = new | ||||
| 
 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -1,3 +1,4 @@ | |||
| # Exceptions for 404 and custom errors are defined here. | ||||
| module Kemal::Exceptions | ||||
|   class RouteNotFound < Exception | ||||
|     def initialize(context) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue