class Mux::Router
- Mux::Router
- Reference
- Object
Overview
The router usually passed as an argument to HTTP::Server.new
.
Included Modules
- HTTP::Handler
Defined in:
mux.crConstant Summary
-
ALL_METHODS =
:all
-
the placehoder for all methods
Constructors
-
.new
create a new router with no routes.
Instance Method Summary
-
#add_handler(path : String, handler : HTTP::Handler, *, method : String | Symbol = ALL_METHODS)
add handler using and optionally specify the method
-
#add_handler(path : String, *, method : String | Symbol = ALL_METHODS, &handler : HandlerProc)
add handler using and optionally specify the method
-
#call(context)
implementes HTTP::Handler
-
#connect(path, handler : HTTP::Handler)
add HTTP connect handler using a hanlder class
-
#connect(path, &handler : HandlerProc)
add HTTP connect handler using a handler proc
-
#delete(path, handler : HTTP::Handler)
add HTTP delete handler using a hanlder class
-
#delete(path, &handler : HandlerProc)
add HTTP delete handler using a handler proc
-
#get(path, handler : HTTP::Handler)
add HTTP get handler using a hanlder class
-
#get(path, &handler : HandlerProc)
add HTTP get handler using a handler proc
-
#head(path, handler : HTTP::Handler)
add HTTP head handler using a hanlder class
-
#head(path, &handler : HandlerProc)
add HTTP head handler using a handler proc
-
#options(path, handler : HTTP::Handler)
add HTTP options handler using a hanlder class
-
#options(path, &handler : HandlerProc)
add HTTP options handler using a handler proc
-
#patch(path, handler : HTTP::Handler)
add HTTP patch handler using a hanlder class
-
#patch(path, &handler : HandlerProc)
add HTTP patch handler using a handler proc
-
#post(path, handler : HTTP::Handler)
add HTTP post handler using a hanlder class
-
#post(path, &handler : HandlerProc)
add HTTP post handler using a handler proc
-
#put(path, handler : HTTP::Handler)
add HTTP put handler using a hanlder class
-
#put(path, &handler : HandlerProc)
add HTTP put handler using a handler proc
-
#trace(path, handler : HTTP::Handler)
add HTTP trace handler using a hanlder class
-
#trace(path, &handler : HandlerProc)
add HTTP trace handler using a handler proc
Constructor Detail
Instance Method Detail
add handler using and optionally specify the method
path
the path to register the handler underhandler
the handler to register at the given pathmethod
the method to filter for, ifALL_METHODS
is used, no restrictions are made and all methods will trigger the handler.
add handler using and optionally specify the method
path
the path to register the handler underhandler
the handler to register at the given pathmethod
the method to filter for, ifALL_METHODS
is used, no restrictions are made and all methods will trigger the handler.
add HTTP connect handler using a hanlder class
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP connect handler using a handler proc
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP delete handler using a hanlder class
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP delete handler using a handler proc
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP get handler using a hanlder class
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP get handler using a handler proc
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP head handler using a hanlder class
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP head handler using a handler proc
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP options handler using a hanlder class
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP options handler using a handler proc
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP patch handler using a hanlder class
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP patch handler using a handler proc
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP post handler using a hanlder class
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP post handler using a handler proc
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP put handler using a hanlder class
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP put handler using a handler proc
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP trace handler using a hanlder class
path
the path to register the handler underhandler
the handler to register at the given path
add HTTP trace handler using a handler proc
path
the path to register the handler underhandler
the handler to register at the given path