MCPcopy Create free account
hub / github.com/3rdparty/libprocess / route

Method route

src/process.cpp:3909–3929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3907
3908
3909void ProcessBase::route(
3910 const string& name,
3911 const Option<string>& help_,
3912 const HttpRequestHandler& handler,
3913 const RouteOptions& options)
3914{
3915 // Routes must start with '/'.
3916 CHECK(name.find('/') == 0);
3917
3918 // To avoid ambiguity between "/path" and "/path/" we disallow the latter.
3919 CHECK(name.size() == 1 || name.back() != '/')
3920 << "Routes must not end with '/'" << ": " << name;
3921
3922 HttpEndpoint endpoint;
3923 endpoint.handler = handler;
3924 endpoint.options = options;
3925
3926 handlers.http[name.substr(1)] = endpoint;
3927
3928 dispatch(help, &Help::add, pid.id, name, help_);
3929}
3930
3931
3932void ProcessBase::route(

Callers

nothing calls this directly

Calls 2

dispatchFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected