-
Notifications
You must be signed in to change notification settings - Fork 0
Quilt dispatch language
StoneyJackson edited this page Feb 11, 2012
·
9 revisions
(Very rough draft; hack away!)
The dispatcher inspects elements of a request (its URI, its headers, maybe even its body), and identifies the quilt document to handle the request. Additionally, it may be desirable to allow the processor to pass variables to the Quilt document, thus parameterizing the Quilt document. These might include URIs to content.
This is heavily based on Apache URL rewrite module. Many consider this a very complicated language. So it may not be suitable.
The dispatcher matches elements of a request against a sequence of rules. The first rule that matches is used identify the Quilt document that will handle the request.
Elements of a Request
- uri
- scheme
- authority
- domain_name
- port
- ip
- path
- fragment
- query_string
- header
- method
Accessing request elements
port
header.key
method
Matching elements against a regular expression
[ domain_name =^github.com$
& header['_gh_sess'] !^$
& path =^/accounts/.*$
] /accounts/pattern.quilt