MantisBase v0.4.9
Loading...
Searching...
No Matches
mb::MbRouteRegistry Class Reference

Thread-local route registry backing the MantisBase router. More...

#include <route_registry.h>

Public Member Functions

void add (const std::string &method, const std::string &path, const MbHandlerFn &handler, const MbMiddlewares &middlewares)
const MbRouteHandler * find (const std::string &method, const std::string &path) const
json remove (const std::string &method, const std::string &path)
 Remove a route from the registry.
void clear ()

Detailed Description

Thread-local route registry backing the MantisBase router.

Member Function Documentation

◆ add()

void mb::MbRouteRegistry::add ( const std::string & method,
const std::string & path,
const MbHandlerFn & handler,
const MbMiddlewares & middlewares )

Register a handler for method + path.

◆ clear()

void mb::MbRouteRegistry::clear ( )
inline

Clear all registered routes

◆ find()

const MbRouteHandler * mb::MbRouteRegistry::find ( const std::string & method,
const std::string & path ) const
Returns
Route handler metadata, or nullptr if not registered.

◆ remove()

json mb::MbRouteRegistry::remove ( const std::string & method,
const std::string & path )

Remove a route from the registry.

Returns
JSON status payload describing the removal result.

The documentation for this class was generated from the following files: