class ActionController::Server

Included Modules

Defined in:

action-controller/server.cr

Constant Summary

AFTER_HANDLERS = [] of HTTP::Handler
BEFORE_HANDLERS = [] of HTTP::Handler

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module ActionController::Router

delete(path : String, &block : Action) delete, get(path : String, &block : Action) get, head(path : String, &block : Action) head, options(path : String, &block : Action) options, patch(path : String, &block : Action) patch, post(path : String, &block : Action) post, put(path : String, &block : Action) put, route_handler : RouteHandler route_handler

Constructor Detail

def self.new(port : Int32 = 3000, host : String = "127.0.0.1", reuse_port : Bool = true) #

[View source]

Class Method Detail

def self.after(*handlers) #

Adds handlers that should run if a route is not found


[View source]
def self.before(*handlers) #

Adds handlers that should run before routes in this application


[View source]
def self.print_routes #

Used to output route details to the console from a command line switch


[View source]

Instance Method Detail

def close #

Terminates the application gracefully once any cluster processes have exited


[View source]
def cluster(count, short_arg, long_arg, args = ARGV.dup) #

Launches additional worker processes removing the short and long arguments that trigger this method


[View source]
def cluster(count) #

Forks additional worker processes


[View source]
def host : String #

[View source]
def port : Int32 #

[View source]
def print_addresses #

Prints the addresses that the server is listening on


[View source]
def reload #

[View source]
def run(&) #

Starts the server, providing a callback once the ports are bound


[View source]
def run #

Starts the server


[View source]
def socket : HTTP::Server #

Provides access the HTTP server for the purpose of binding For example server.socket.bind_unix "/tmp/my-socket.sock"


[View source]