ops::http::server class

REST server.

Constructors, destructors, conversion operators

server(const uint16_t port = 9080, const std::string& scheme = "http", const std::string& host = "localhost", const std::string& path = "")
Create the server.

Public functions

void run()
Run the server.
void run(const uint16_t port)
Run the server on a specific port.
void set_port(const uint16_t port)
Configure the server to listen on the given port for incoming connections.
void on(const web::http::method& method, const std::string& uri_pattern, request_handler handler)
Register a request handler.

Function documentation

void ops::http::server::run(const uint16_t port)

Run the server on a specific port.

Parameters
port the port number

void ops::http::server::set_port(const uint16_t port)

Configure the server to listen on the given port for incoming connections.

Parameters
port the port number

void ops::http::server::on(const web::http::method& method, const std::string& uri_pattern, request_handler handler)

Register a request handler.

Parameters
method todo
uri_pattern todo
handler todo