|
RAVENNAKIT
|
A simple HTTP router that matches HTTP requests to handlers based on the method and path. More...
#include <http_router.hpp>
Public Member Functions | |
| void | insert (const boost::beast::http::verb method, const std::string_view pattern, HandlerType handler) |
| Inserts a new route into the router. | |
| HandlerType * | match (const boost::beast::http::verb method, const std::string_view path, PathMatcher::Parameters *parameters) |
| Matches the given method and path to a handler. | |
A simple HTTP router that matches HTTP requests to handlers based on the method and path.
| HandlerType | The type of the handler function. |
Definition at line 44 of file http_router.hpp.
|
inline |
Inserts a new route into the router.
If a handler already exists for the given method and pattern, it will be updated.
| method | The HTTP method to match (e.g., GET, POST). |
| pattern | The path pattern to match. |
| handler | The handler function to call when the route is matched. |
Definition at line 53 of file http_router.hpp.
|
inline |
Matches the given method and path to a handler.
If a matching route is found, the handler is returned.
| method | The HTTP method to match (e.g., GET, POST). |
| path | The path to match. |
| parameters | The parameters to fill with the extracted values from the path. |
Definition at line 76 of file http_router.hpp.