class
Radbas::RouteCollector
- Radbas::RouteCollector
- Reference
- Object
Overview
Maps routes and groups them under a common path and middleware.
Included Modules
Direct Known Subclasses
Defined in:
radbas-framework/route_collector.crConstructors
Instance Method Summary
-
#delete(path : String, action : ActionLike, name : String | Nil = nil) : self
Maps a
DELETEroute. -
#get(path : String, action : ActionLike, name : String | Nil = nil) : self
Maps a
GETroute. -
#group(path : String = "", & : RouteCollector -> ) : self
Yields a collector for routes below path.
-
#head(path : String, action : ActionLike, name : String | Nil = nil) : self
Maps a
HEADroute. -
#map(method : String, path : String, action : ActionLike, name : String | Nil = nil) : self
Maps method and path to action, optionally naming the route for
Routing::Router#build. -
#options(path : String, action : ActionLike, name : String | Nil = nil) : self
Maps a
OPTIONSroute. -
#patch(path : String, action : ActionLike, name : String | Nil = nil) : self
Maps a
PATCHroute. -
#post(path : String, action : ActionLike, name : String | Nil = nil) : self
Maps a
POSTroute. -
#put(path : String, action : ActionLike, name : String | Nil = nil) : self
Maps a
PUTroute. -
#sse(path : String, handler : StreamHandlerLike, name : String | Nil = nil) : self
Maps a server-sent events endpoint at path.
-
#ws(path : String, handler : SocketHandlerLike, name : String | Nil = nil) : self
Maps a websocket endpoint at path.
Instance methods inherited from module Radbas::MiddlewareCollector
add(http_handler : HTTP::Handler) : selfadd(middleware : MiddlewareLike) : self add
Constructor Detail
Instance Method Detail
Maps a DELETE route.
Maps a GET route.
Yields a collector for routes below path.
The group starts with this collector's middleware. Middleware added to the group applies to all of the group's routes.
Maps a HEAD route.
Maps method and path to action, optionally naming the route for Routing::Router#build.
Maps a OPTIONS route.
Maps a PATCH route.
Maps a POST route.
Maps a PUT route.
Maps a server-sent events endpoint at path.
Maps a websocket endpoint at path.