Template Class application

Class Documentation

template<typename DerivedT>
class udho::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>
auto get(F f)

add a get method

Template Parameters
  • F: callback type

Parameters
  • f: callback

template<typename F>
auto post(F f)

add a post method

Template Parameters
  • F: callback type

Parameters
  • f: callback

template<typename F>
auto head(F f)

add a head method

Template Parameters
  • F: callback type

Parameters
  • f: callback

template<typename F>
auto put(F f)

add a put method

Template Parameters
  • F: callback type

Parameters
  • f: callback

template<typename F>
auto del(F f)

add a delete method

Template Parameters
  • F: callback type

Parameters
  • f: callback