class
Amber::DSL::SchemaRouter
- Amber::DSL::SchemaRouter
- Reference
- Object
Overview
Extended Router that processes Schema annotations This is identical to the regular Router but adds Schema annotation processing
Defined in:
amber/dsl/schema_router.crConstant Summary
-
RESOURCES =
[:get, :post, :put, :patch, :delete, :options, :head, :trace, :connect]
Constructors
Macro Summary
-
api_version(version, strategy = :url, prefix = "", header = "Api-Version", media_type = "application/vnd.amber")
API versioning macro
- connect(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
- delete(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
- get(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
- head(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
- namespace(scoped_namespace)
- options(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
- patch(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
- post(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
- put(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
- resources(resource, controller, only = nil, except = nil, constraints = {} of String => Regex)
-
route(verb, resource, controller, action, constraints = {} of String => Regex, route_name = nil)
Enhanced route macro that works exactly like the regular router Schema annotation processing happens inside the controller
- trace(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
Instance Method Summary
- #active_constraint : Amber::Router::Constraint | Nil
-
#constraint(constraint_object : Amber::Router::Constraint, &)
Scopes all routes defined in the block to require the given constraint.
- #router : Amber::Router::Router
- #scope : Amber::Router::Scope
- #valve : Symbol
- #websocket(path, app_socket)
Constructor Detail
Macro Detail
macro api_version(version, strategy = :url, prefix = "", header = "Api-Version", media_type = "application/vnd.amber")
#
API versioning macro
macro connect(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
#
macro options(resource, controller, action, constraints = {} of String => Regex, route_name = nil)
#
macro resources(resource, controller, only = nil, except = nil, constraints = {} of String => Regex)
#
macro route(verb, resource, controller, action, constraints = {} of String => Regex, route_name = nil)
#
Enhanced route macro that works exactly like the regular router Schema annotation processing happens inside the controller
Instance Method Detail
def constraint(constraint_object : Amber::Router::Constraint, &)
#
Scopes all routes defined in the block to require the given constraint.