RegisterHTTPHandler

Register handler for prefix. If multiple handlers match a prefix, the first-registered one will be invoked.

Synopsis

Declared in <httpserver.h>

void
RegisterHTTPHandler(
    std::string const& prefix,
    bool exactMatch,
    HTTPRequestHandler const& handler);

Parameters

NameDescription
prefixThe URI path prefix the handler responds to.
exactMatchIf true, only a request whose path equals prefix matches; otherwise any path starting with prefix matches.
handlerThe callback invoked for matching requests.