$darkmode
#include <server.hpp>
Public Member Functions | |
| void | operator() (ServerImpl::request const &, ServerImpl::connection_ptr) |
| void | log (const ServerImpl::string_type &msg) |
| void | add (const std::string &key, Handler h) |
| std::vector< std::string > | endpoints () const |
| cloe::Json | endpoints_to_json (const std::vector< std::string > &endpoints) const |
ServerImplHandler is the main request handler for the server.
It implements an interface defined by boost::network::http::server.
| void oak::ServerImplHandler::add | ( | const std::string & | key, |
| Handler | h | ||
| ) |
Add a handler for a specific endpoint.
|
inline |
Return a list of all registered endpoints.
| cloe::Json oak::ServerImplHandler::endpoints_to_json | ( | const std::vector< std::string > & | endpoints | ) | const |
Return endpoint data in json format.
| void oak::ServerImplHandler::log | ( | const ServerImpl::string_type & | msg | ) |
Log an error from the server.
| void oak::ServerImplHandler::operator() | ( | ServerImpl::request const & | request, |
| ServerImpl::connection_ptr | conn | ||
| ) |
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.