$darkmode
oak::GreedyHandler Class Reference
Inheritance diagram for oak::GreedyHandler:
Collaboration diagram for oak::GreedyHandler:

Public Member Functions

std::shared_ptr< OutgoingResponse > handle (const std::shared_ptr< IncomingRequest > &request) override
 
void add (const std::string &key, cloe::Handler h)
 
std::vector< std::string > endpoints () const
 
fable::Json endpoints_to_json (const std::vector< std::string > &endpoints) const
 

Detailed Description

The GreedyHandler is a stop-gap till we refactor the server code.

Instead of it handling a single route, it handles all routes, hence the name.

HttpRequestHandler defines several typedefs which are used within this class, such as OutgoingResponse and IncomingRequest.

Member Function Documentation

◆ add()

void oak::GreedyHandler::add ( const std::string &  key,
cloe::Handler  h 
)
inline

Add a handler for a specific endpoint.

◆ endpoints()

std::vector<std::string> oak::GreedyHandler::endpoints ( ) const
inline

Return a list of all registered endpoints.

◆ endpoints_to_json()

fable::Json oak::GreedyHandler::endpoints_to_json ( const std::vector< std::string > &  endpoints) const
inline

Return endpoint data in json format.

◆ handle()

std::shared_ptr<OutgoingResponse> oak::GreedyHandler::handle ( const std::shared_ptr< IncomingRequest > &  request)
inlineoverride

Handle every request from the server.

Every single request that passes through the server has to go through this handler. If the muxer has an endpoint that matches the request, then it gets passed through. The muxer has a default endpoint, so the nominal case is that every request is passed to some handler from the muxer.


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