Method

CogHostRoutesHandleradd_path

Declaration [src]

gboolean
cog_host_routes_handler_add_path (
  CogHostRoutesHandler* self,
  const char* host,
  const char* base_path
)

Description [src]

Adds a route to the handler pointing to a directory.

This is a convenience method which configures a route matching host in URI, and creates a new CogDirectoryFilesHandler for base_path to handle requests for the route.

Parameters

host const char*
 

URI path host to match.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
base_path const char*
 

Path to a local directory.

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

Return value

Returns: gboolean
 

Whether the route was successfully added.