Justin Sheehy avatar Justin Sheehy committed d2c705f

Automated commit message

Comments (0)

Files changed (1)

DispatchConfiguration.wiki

-== Webmachine URI dispatch configuration ==
-
-This page describes the configuration of URI dispatch to resources in a webmachine application. The dispatch map data structure is a list of 3-tuples, where each entry is of the form {pathspec, resource, args}. The first pathspec in the list that matches the URI for a request will cause the corresponding resource to be used in handling that request.
-
-A {{{ pathspec }}} is a list of pathterms. A pathterm is any of [string,atom,star] where star is just the atom of "*". The pathspec-matching is done by breaking up the request URI into tokens via the "/" separator and matching those tokens against the pathterms. A string pathterm will match a token if the token is equal to that string. A non-star atom will match any single token. The star atom (* in single quotes) will match any number of tokens, but may only be present as the last pathterm in a pathspec. If all tokens are matched and all pathterms are used, then the pathspec matches.  The tokens used are available in {{{ wrq:path_tokens(ReqData) }}} in the resource functions.
-
-Any atom pathterms that were used in a match will cause a binding in the path_info element of the request's [[WebmachineReqData]]. (if there was a foo atom that matched the token "bar", then {{{ wrq:get_path_info(foo, ReqData) }}} will return {{{ "bar" }}} inside the resource calls) If there was a star pathterm in the pathspec, then {{{ wrq:disp_path(ReqData) }}} in a resource function will return the URI portion that was matched by the star.
-
-The {{{ resource }}} is an atom identifying a [[WebmachineResources|resource]] that should handle a matching request. It will have the {{{ args }}} (which must be a list) passed to its init function before request handling begins. 
+== Webmachine URI dispatch configuration ==
+
+This page describes the configuration of URI dispatch to resources in a webmachine application. The dispatch map data structure is a list of 3-tuples, where each entry is of the form {pathspec, resource, args}. The first pathspec in the list that matches the URI for a request will cause the corresponding resource to be used in handling that request.
+
+A {{{ pathspec }}} is a list of pathterms. A pathterm is any of [string,atom,star] where star is just the atom of "*". The pathspec-matching is done by breaking up the request URI into tokens via the "/" separator and matching those tokens against the pathterms. A string pathterm will match a token if the token is equal to that string. A non-star atom will match any single token. The star atom (* in single quotes) will match any number of tokens, but may only be present as the last pathterm in a pathspec. If all tokens are matched and all pathterms are used, then the pathspec matches.  The tokens used are available in {{{ wrq:path_tokens(ReqData) }}} in the resource functions.
+
+Any atom pathterms that were used in a match will cause a binding in the path_info element of the request's [[WebmachineReqData|ReqData]]. (if there was a foo atom that matched the token "bar", then {{{ wrq:get_path_info(foo, ReqData) }}} will return {{{ "bar" }}} inside the resource calls) If there was a star pathterm in the pathspec, then {{{ wrq:disp_path(ReqData) }}} in a resource function will return the URI portion that was matched by the star.
+
+The {{{ resource }}} is an atom identifying a [[WebmachineResources|resource]] that should handle a matching request. It will have the {{{ args }}} (which must be a list) passed to its init function before request handling begins. 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.