mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Refactor class level DSL with macros to convert blocks to instance-scoped methods
This commit is contained in:
		
							parent
							
								
									53fa65f964
								
							
						
					
					
						commit
						ad91a22789
					
				
					 6 changed files with 179 additions and 51 deletions
				
			
		
							
								
								
									
										17
									
								
								samples/app_squared.cr
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								samples/app_squared.cr
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| require "../src/kemal/base" | ||||
| 
 | ||||
| class MyApp < Kemal::Application | ||||
|   get "/" do |env| | ||||
|     "Hello Kemal!" | ||||
|   end | ||||
| end | ||||
| 
 | ||||
| class OtherApp < Kemal::Application | ||||
|   get "/" do |env| | ||||
|     "Hello World!" | ||||
|   end | ||||
| end | ||||
| 
 | ||||
| spawn { MyApp.run(3002) } | ||||
| 
 | ||||
| OtherApp.run(3001) | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue