mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Change single quotes to double quotes
This commit is contained in:
		
							parent
							
								
									d0ea2f049c
								
							
						
					
					
						commit
						5bc81e7e5b
					
				
					 1 changed files with 9 additions and 9 deletions
				
			
		
							
								
								
									
										18
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								README.md
									
										
									
									
									
								
							|  | @ -42,23 +42,23 @@ dependencies: | |||
| In Kemal, a route is an HTTP method paired with a URL-matching pattern. Each route is associated with a block: | ||||
| 
 | ||||
| ```ruby | ||||
|   get '/' do | ||||
|   get "/" do | ||||
|   .. show something .. | ||||
|   end | ||||
| 
 | ||||
|   post '/' do | ||||
|   post "/" do | ||||
|   .. create something .. | ||||
|   end | ||||
| 
 | ||||
|   put '/' do | ||||
|   put "/" do | ||||
|   .. replace something .. | ||||
|   end | ||||
| 
 | ||||
|   patch '/' do | ||||
|   patch "/" do | ||||
|   .. modify something .. | ||||
|   end | ||||
| 
 | ||||
|   delete '/' do | ||||
|   delete "/" do | ||||
|   .. annihilate something .. | ||||
|   end   | ||||
| ``` | ||||
|  | @ -69,13 +69,13 @@ Accessing the request context (query params, body, headers e.g) is super easy. Y | |||
| 
 | ||||
| ```ruby | ||||
|   # Matches /hello/kemal | ||||
|   get '/hello/:name' do |ctx| | ||||
|   get "/hello/:name" do |ctx| | ||||
|     name = ctx.params["name"] | ||||
|     "Hello back to #{name}" | ||||
|   end | ||||
| 
 | ||||
|   # Matches /resize?width=200&height=200 | ||||
|   get '/resize' do |ctx| | ||||
|   get "/resize" do |ctx| | ||||
|     width = ctx.params["width"] | ||||
|     height = ctx.params["height"] | ||||
|   end | ||||
|  | @ -86,8 +86,8 @@ Kemal uses *text/html* as the default content type. You can change it via the co | |||
| 
 | ||||
| ```ruby | ||||
|   # Set the content as application/json and return JSON | ||||
|   get '/user.json' do |ctx| | ||||
|     kemal = {name: 'Kemal', language: 'Crystal'} | ||||
|   get "/user.json" do |ctx| | ||||
|     kemal = {name: "Kemal", language: "Crystal"} | ||||
|     ctx.set_content_type "application/json" | ||||
|     kemal.to_json | ||||
|   end | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue