Refactor class level DSL with macros to convert blocks to instance-scoped methods

This commit is contained in:
Johannes Müller 2017-07-20 10:48:31 +02:00 committed by sdogruyol
parent 53fa65f964
commit ad91a22789
6 changed files with 179 additions and 51 deletions

17
samples/app_squared.cr Normal file
View 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)