A domain which dispatches URL requests to commands within a namespace or methods within an object. Note that only commands whose name starts with '/' will be exported to the web.
Create a namespace NS containing commands of the form [proc /name {r arg1 arg2 ...} {}]
[Nub domain /prefix/ Direct namespace NS]
Now any URL reference to /prefix/FRED will invoke the command ::NS::/FRED with any URL query args passed as actual parameters.
A target URL is interpreted as a command/method invocation with its query arguments interpreted as actual parameters.
Argument defaults are honoured, as is the $args formal parameter - unspecified query arguments are passed into the target command as a dict. Multiple query args with the same name are passed as a list of values.
Prefix invocation is supported, where a url like /fred/wilma will be matched by command /fred if /fred/wilma is not found. The unmatched url suffix can be found in [dict $r get -extra]
Wildcard invocation is supported, with unmatched urls being handled by a nominated default command.
Different varieties of command might be supported. Specifically, interps should be considered as a valid command container.
This concept is an extension of TclHttpd's domain of the same name.
(generated by STX)