|
MantisBase v0.3.4
|
#include <route_registry.h>
Public Member Functions | |
| void | add (const std::string &method, const std::string &path, HandlerFn handler, const Middlewares &middlewares) |
| Add new route to the registry. | |
| void | add (const std::string &method, const std::string &path, HandlerWithContentReaderFn handler, const Middlewares &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__ = "mb::RouteRegistry" |
Class to manage route registration, removal and dynamic checks on request.
| void mb::RouteRegistry::add | ( | const std::string & | method, |
| const std::string & | path, | ||
| HandlerFn | handler, | ||
| const Middlewares & | 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 |
| void mb::RouteRegistry::add | ( | const std::string & | method, |
| const std::string & | path, | ||
| HandlerWithContentReaderFn | handler, | ||
| const Middlewares & | 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 RouteHandler * mb::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. |
| json mb::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 mb::RouteRegistry::__class_name__ = "mb::RouteRegistry" |