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
							
								
									7a772a9301
								
							
						
					
					
						commit
						596452f838
					
				
					 5 changed files with 57 additions and 54 deletions
				
			
		|  | @ -1,4 +1,7 @@ | |||
| require "http" | ||||
| require "json" | ||||
| require "uri" | ||||
| require "tempfile" | ||||
| require "./kemal/*" | ||||
| require "./kemal/helpers/*" | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,4 +1,8 @@ | |||
| class Kemal::Handler | ||||
| module Kemal | ||||
|   # `Kemal::Handler` is a subclass of `HTTP::Handler`. | ||||
|   # It adds `only`, `only_match?`, `exclude`, `exclude_match?`. | ||||
|   # These methods are useful for custom handlers for conditional execution. | ||||
|   class Handler | ||||
|     include HTTP::Handler | ||||
|     @@only_routes_tree = Radix::Tree(String).new | ||||
|     @@exclude_routes_tree = Radix::Tree(String).new | ||||
|  | @ -63,3 +67,4 @@ class Kemal::Handler | |||
|       "#{self.class}/#{method.downcase}#{path}" | ||||
|     end | ||||
|   end | ||||
| end | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| module Kemal | ||||
|   # Kemal::InitHandler is the first handler thus initializes the context with default values such as | ||||
|   # Content-Type, X-Powered-By. | ||||
|   # Kemal::InitHandler is the first handler thus initializes the context with default values. | ||||
|   # Such as *Content-Type*, *X-Powered-By* headers. | ||||
|   class InitHandler | ||||
|     include HTTP::Handler | ||||
|     INSTANCE = new | ||||
|  |  | |||
|  | @ -1,7 +1,3 @@ | |||
| require "json" | ||||
| require "uri" | ||||
| require "tempfile" | ||||
| 
 | ||||
| module Kemal | ||||
|   # ParamParser parses the request contents including query_params and body | ||||
|   # and converts them into a params hash which you can within the environment | ||||
|  |  | |||
|  | @ -1,4 +1,3 @@ | |||
| # Opening HTTP::Request to add override_method property | ||||
| class HTTP::Request | ||||
|   property override_method | ||||
|   property url_params : Hash(String, String)? | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue