Template Struct basic_router

Inheritance Relationships

Base Type

Struct Documentation

template<typename AuxT = void>
struct udho::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

Public Functions

template<typename ...Args>
basic_router(Args... args)

cnstructs a router

Friends

template<typename U, typename V, typename F>
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