abstract class Application

Direct Known Subclasses

Defined in:

controllers/application.cr

Constant Summary

AFTER = {} of Nil => Nil
AROUND = {} of Nil => Nil
BEFORE = {set_request_id => {nil, nil}, set_date_header => {nil, nil}, set_cors => {nil, nil}} of Nil => Nil
FORCE = {} of Nil => Nil
LOCAL_AFTER = {} of Nil => Nil

function => options

LOCAL_AROUND = {} of Nil => Nil

function => options

LOCAL_BEFORE = {set_request_id => {nil, nil}, set_date_header => {nil, nil}, set_cors => {nil, nil}} of Nil => Nil

function => options

LOCAL_FORCE = {} of Nil => Nil

function => options

LOCAL_RESCUE = {} of Nil => Nil

function => options

LOCAL_ROUTES = {} of Nil => Nil

function => options

LOCAL_SKIP = {} of Nil => Nil

function => options

Log = ::App::Log.for("controller")

Configure your log source name

NOTE : this is chaining from App::Log

NAMESPACE = ["/application"]

default namespace based on class

RESCUE = {} of Nil => Nil
ROUTES = {} of Nil => Nil
SKIP = {} of Nil => Nil

Class Method Summary

Instance Method Summary

Macro Summary

Class Method Detail

def self.context(method : String, route : String, route_params : Hash(String, String) | Nil = nil, headers : Hash(String, String) | Nil = nil, body : String | Bytes | IO | Nil = nil, &) #

[View source]

Instance Method Detail

def set_cors #

CORS Set-Up


[View source]
def set_date_header #

[View source]
def set_request_id #

This makes it simple to match client requests with server side logs. When building microservices this ID should be propagated to upstream services.


[View source]

Macro Detail

macro __inherit_after_filters__ #

macro __inherit_around_filters__ #

macro __inherit_before_filters__ #

macro __inherit_force_filters__ #

macro __inherit_rescue_filters__ #

macro __inherit_routes_filters__ #

macro __inherit_skip_filters__ #