Template Struct basic_router¶
Defined in File router.h
Inheritance Relationships¶
Base Type¶
public udho::overload_group< void, overload_terminal< AuxT > >(Template Struct overload_group)
Struct Documentation¶
-
template<typename
AuxT= void>
structudho::basic_router: public udho::overload_group<void, overload_terminal<AuxT>>¶ router maps HTTP requests with the callbacks
auto router = udho::router() | (udho::get(add).plain() = "^/add/(\\d+)/(\\d+)$") | (udho::get(hello).plain() = "^/hello$");
Public Types
-
typedef overload_group<void, overload_terminal<AuxT>>
base_type¶
Friends
-
template<typename
U, typenameV, typenameF>
friend overload_group<overload_group<U, V>, F>operator|(const overload_group<U, V> &group, const F &method)¶ adds a callback url mapping to the router by conjugating an overload in the overload meta-chain. The url mapping is provided by content wrappers like content_wrapper0 content_wrapper1 which attaches feasibility criteria like http resource path, http verb with a callback function. The url mapping can be built using get post put head etc.. See router for an example
- Parameters
group: the overload group (which is actually the router or router attached with some url mappings)method: url mapping
-
typedef overload_group<void, overload_terminal<AuxT>>