{ $description "Creates a new instance of a subclass of " { $link dispatcher } "." } ;
HELP:dispatcher
{ $description "The class of dispatchers. May be subclassed, in which case subclasses should be constructed by calling " { $link new-dispatcher } "." } ;
HELP:<dispatcher>
{ $values { "dispatcher" dispatcher } }
{ $description "Creates a new pathname dispatcher." } ;
HELP:vhost-dispatcher
{ $description "The class of virtual host dispatchers." } ;
HELP:<vhost-dispatcher>
{ $values { "dispatcher" vhost-dispatcher } }
{ $description "Creates a new virtual host dispatcher." } ;
"In the above example, visiting any URL other than " { $snippet "/new" } ", " { $snippet "/edit" } ", " { $snippet "/delete" } ", or " { $snippet "/" } " will result in a 404 error."
"Note that the virtual host dispatcher strips off a " { $snippet "www." } " prefix, so " { $snippet "www.concatenative-casino.com" } " would be routed to the " { $snippet "<casino>" } " responder instead of receiving a 404.";
ARTICLE: "http.server.dispatchers""HTTP dispatchers and virtual hosting"
"The " { $vocab-link "http.server.dispatchers" } " vocabulary implements two responders which route HTTP requests to one or more child responders."
{ $subsection "http.server.dispatchers.example" }
"Pathname dispatchers implement a directory hierarchy where each subdirectory is its own responder:"
{ $subsection dispatcher }
{ $subsection <dispatcher> }
"Virtual host dispatchers dispatch each virtual host to a different responder:"
{ $subsection vhost-dispatcher }
{ $subsection <vhost-dispatcher> }
"Adding responders to dispatchers:"
{ $subsection add-responder }
"The " { $slot "default" } " slot holds a responder which receives all unrecognized URLs. By default, it responds with 404 messages.";