Template Class application¶
Defined in File application.h
Class Documentation¶
-
template<typename
DerivedT>
classudho::application¶ all applications derive from this class
applications are a class having a set of methods bound with urls
struct my_app: public udho::application<my_app>{ my_app(); int add(udho::request_type req, int a, int b); int mul(udho::request_type req, int a, int b); template <typename RouterT> auto route(RouterT& router){ return router | (get(&my_app::add).plain() = "^/add/(\\d+)/(\\d+)$") | (get(&my_app::mul).plain() = "^/mul/(\\d+)/(\\d+)$"); } };
- Template Parameters
DerivedT: The derived application class
Public Functions
-
application(const std::string &name)¶
-
std::string
name() const¶
-
template<typename
F>
autoget(F f)¶ add a get method
- Template Parameters
F: callback type
- Parameters
f: callback
-
template<typename
F>
autopost(F f)¶ add a post method
- Template Parameters
F: callback type
- Parameters
f: callback
-
template<typename
F>
autohead(F f)¶ add a head method
- Template Parameters
F: callback type
- Parameters
f: callback