regex


Description:

public void regex (Method method, Regex regex, owned HandlerCallback cb)

Bind a callback to a given method and regular expression.

The providen regular expression pattern will be extracted, scoped, anchored and optimized. This means you must not anchor the regex yourself with '^' and '$' characters and providing a pre-optimized GLib.Regex is useless.

The method will be marked as provided with the Valum.Method.PROVIDED flag.

Parameters:

method

flag for allowed HTTP methods

regex

regular expression matching the request path

cb

callback used to process the pair of request and response