Method

CogHostRoutesHandleradd

Declaration [src]

gboolean
cog_host_routes_handler_add (
  CogHostRoutesHandler* self,
  const char* host,
  CogRequestHandler* handler
)

Description [src]

Adds a route to the handler.

Configures a route which matches host in URI, and dispatches requests to a given handler.

Parameters

host const char*
 

URI host to match.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
handler CogRequestHandler
 

A request handler for the matched host.

 The data is owned by the caller of the function.

Return value

Returns: gboolean
 

Whether the route was successfully added.