class Amber::DSL::SchemaRouter

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.cr

Constant Summary

RESOURCES = [:get, :post, :put, :patch, :delete, :options, :head, :trace, :connect]

Constructors

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(router : Amber::Router::Router, valve : Symbol, scope : Amber::Router::Scope) #

[View source]

Macro Detail

macro api_version(version, strategy = :url, prefix = "", header = "Api-Version", media_type = "application/vnd.amber") #

API versioning macro


[View source]
macro connect(resource, controller, action, constraints = {} of String => Regex, route_name = nil) #

[View source]
macro delete(resource, controller, action, constraints = {} of String => Regex, route_name = nil) #

[View source]
macro get(resource, controller, action, constraints = {} of String => Regex, route_name = nil) #

[View source]
macro head(resource, controller, action, constraints = {} of String => Regex, route_name = nil) #

[View source]
macro namespace(scoped_namespace) #

[View source]
macro options(resource, controller, action, constraints = {} of String => Regex, route_name = nil) #

[View source]
macro patch(resource, controller, action, constraints = {} of String => Regex, route_name = nil) #

[View source]
macro post(resource, controller, action, constraints = {} of String => Regex, route_name = nil) #

[View source]
macro put(resource, controller, action, constraints = {} of String => Regex, route_name = nil) #

[View source]
macro resources(resource, controller, only = nil, except = nil, constraints = {} of String => Regex) #

[View source]
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


[View source]
macro trace(resource, controller, action, constraints = {} of String => Regex, route_name = nil) #

[View source]

Instance Method Detail

def active_constraint : Amber::Router::Constraint | Nil #

[View source]
def constraint(constraint_object : Amber::Router::Constraint, &) #

Scopes all routes defined in the block to require the given constraint.


[View source]
def router : Amber::Router::Router #

[View source]
def scope : Amber::Router::Scope #

[View source]
def valve : Symbol #

[View source]
def websocket(path, app_socket) #

[View source]