![]() |
Mantis App v0.1.13
|
#include <http.h>
Public Member Functions | |
void | add (const std::string &method, const std::string &path, RouteHandlerFunc handler, const std::vector< Middleware > &middlewares) |
Add new route to the registry. | |
const RouteHandler * | find (const std::string &method, const std::string &path) const |
Find a route in the registry matching given method and route. | |
json | remove (const std::string &method, const std::string &path) |
Remove find and remove existing route + path pair from the registry. | |
Public Attributes | |
const std::string | __class_name__ = "mantis::RouteRegistry" |
Class to manage route registration, removal and dynamic checks on request.
void mantis::RouteRegistry::add | ( | const std::string & | method, |
const std::string & | path, | ||
RouteHandlerFunc | handler, | ||
const std::vector< Middleware > & | middlewares | ||
) |
Add new route to the registry.
method | Request method, i.e. GET, POST, PATCH, etc. |
path | Request path. |
handler | Request handler function. |
middlewares | List of |
const mantis::RouteHandler * mantis::RouteRegistry::find | ( | const std::string & | method, |
const std::string & | path | ||
) | const |
Find a route in the registry matching given method and route.
method | Request method. |
path | Request path. |
mantis::json mantis::RouteRegistry::remove | ( | const std::string & | method, |
const std::string & | path | ||
) |
Remove find and remove existing route + path pair from the registry.
method | Request method |
path | Request path |
const std::string mantis::RouteRegistry::__class_name__ = "mantis::RouteRegistry" |