Represents a single HTTP route. More...
#include <RouteTypes.h>
Public Member Functions | |
Route (const std::string &m, const std::string &p, RouteHandler h, bool dynamic=false, bool auth=false, const std::vector< std::string > ¶ms={}) | |
Route ()=default | |
Public Attributes | |
std::string | method |
std::string | path |
std::regex | compiledRegex |
RouteHandler | handler |
bool | isDynamic |
bool | requiresAuth |
std::vector< std::string > | paramNames |
This structure encapsulates the method, path, handler function, and metadata about the route. It supports both static and dynamic routes, as well as authentication requirements.
Definition at line 41 of file RouteTypes.h.
|
inline |
Definition at line 51 of file RouteTypes.h.
|
default |
std::regex Route::compiledRegex |
Definition at line 45 of file RouteTypes.h.
Referenced by Router::handleRequest().
RouteHandler Route::handler |
Definition at line 46 of file RouteTypes.h.
Referenced by Router::handleRequest().
bool Route::isDynamic |
Definition at line 47 of file RouteTypes.h.
Referenced by Router::printRoutes().
std::string Route::method |
Definition at line 43 of file RouteTypes.h.
std::vector<std::string> Route::paramNames |
Definition at line 49 of file RouteTypes.h.
Referenced by Router::handleRequest().
std::string Route::path |
Definition at line 44 of file RouteTypes.h.
Referenced by Router::handleRequest(), and Router::printRoutes().
bool Route::requiresAuth |
Definition at line 48 of file RouteTypes.h.
Referenced by Router::printRoutes().