The Crystal programming language | http://crystal-lang.org | Fund Crystal's development: http://is.gd/X7PRtI | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/
class MyApp < Kemal::Application
get "/" do |env|
"hello"
end
# `instance_routes` could be a macro that will define the `initialize_instance_routes` method
instance_routes do # Here using `with .. yield`, the instance routes can be configured with another DSL (could be methods, .. whatever)
get "/foo" do |env|
"bar"
end
end
end
app = MyApp.new
app.initialize_instance_routes
app.run
get
method would actually call route_handler.add_route("GET", path, &block)
MyGenericClass(typeof({{value}})).new({{value}})
might work but is redundant