Skip to content

Commit

Permalink
Update doc hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Jan 5, 2012
1 parent 617909c commit ddc0d1a
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ It is worth noting that one of the goals of REST applications is to minimize ser
management of application state, so session use should be generally be avoided or management of application state, so session use should be generally be avoided or
kept to a minimum when possible. kept to a minimum when possible.


JSON-RPC # JSON-RPC
========
Pintura supports JSON-RPC to call methods on objects. One can call a method on a Pintura supports JSON-RPC to call methods on objects. One can call a method on a
persisted object by using the URL for the object, and JSON-RPC encoded request entity persisted object by using the URL for the object, and JSON-RPC encoded request entity
that describes the method invocation to make. For example: that describes the method invocation to make. For example:
Expand All @@ -420,7 +420,7 @@ Pintura will then lookup the object with the id of "/Product/33" and call object
The return value or thrown error from the call will be returned in a JSON-RPC response. The return value or thrown error from the call will be returned in a JSON-RPC response.




## JSGI # JSGI


Pintura is composed of a set of JSGI middleware components. JSGI is designed for Pintura is composed of a set of JSGI middleware components. JSGI is designed for
asynchronous web applications, and is well-suited for NodeJS's asynchronous asynchronous web applications, and is well-suited for NodeJS's asynchronous
Expand Down Expand Up @@ -458,7 +458,7 @@ are found in the "jsgi" folder. Most of these modules directly a function that c
used as the middleware function, and typically take configuration information as the used as the middleware function, and typically take configuration information as the
first parameter and the next application as the second. Below are the syntax and description of these modules: first parameter and the next application as the second. Below are the syntax and description of these modules:


### auth ## auth


app = require('pintura/jsgi/auth')(security, nextApp); app = require('pintura/jsgi/auth')(security, nextApp);


Expand All @@ -469,7 +469,7 @@ property on the promise context if a user is authenticated. This module returns
a middleware function that takes a security object as the first argument, and the a middleware function that takes a security object as the first argument, and the
next app as the second argument. next app as the second argument.


### rest-store ## rest-store


app = require('pintura/jsgi/rest-store')(config); app = require('pintura/jsgi/rest-store')(config);


Expand All @@ -485,7 +485,7 @@ This component will alternately call the query() method if the request is a GET
query string. It will also handle the Range header, converting it to an appropriate limit() query string. It will also handle the Range header, converting it to an appropriate limit()
parameter in the query string. parameter in the query string.


### media ## media


app = require('pintura/jsgi/media').Serialize(mediaSelector, nextApp); app = require('pintura/jsgi/media').Serialize(mediaSelector, nextApp);
app = require('pintura/jsgi/media').Deserialize(mediaSelector, nextApp); app = require('pintura/jsgi/media').Deserialize(mediaSelector, nextApp);
Expand All @@ -500,7 +500,7 @@ The content negotiation is described in more detail in the Content Negotiation s


By default the mediaSelector should come from require("./media").Media.optimumMedia. By default the mediaSelector should come from require("./media").Media.optimumMedia.


### csrf ## csrf


app = require('pintura/jsgi/csrf')(customHeader, nextApp); app = require('pintura/jsgi/csrf')(customHeader, nextApp);


Expand All @@ -517,7 +517,7 @@ property value of true to indicate that it should be regarded with suspicion.


The customHeader argument can be the name of an alternate custom header to test for. The customHeader argument can be the name of an alternate custom header to test for.


### xsite ## xsite


app = require('pintura/jsgi/xsite')(nextApp); app = require('pintura/jsgi/xsite')(nextApp);
app = require('pintura/jsgi/xsite').JsonP(nextApp); app = require('pintura/jsgi/xsite').JsonP(nextApp);
Expand All @@ -537,8 +537,8 @@ to embed the response in a frame to insulate it from arbitrary code execution, a
is described [here](http://www.sitepen.com/blog/2008/07/22/windowname-transport/). is described [here](http://www.sitepen.com/blog/2008/07/22/windowname-transport/).
* CrossSite - This combines support for all three of the mechanisms above. This is the export * CrossSite - This combines support for all three of the mechanisms above. This is the export
of the module. of the module.

### http-params ## http-params


app = require('pintura/jsgi/http-params')(nextApp); app = require('pintura/jsgi/http-params')(nextApp);


Expand All @@ -547,23 +547,23 @@ parameters. This is usually used in conjunction with the xsite middleware to ena
further functionality for cross-domain requests. The following query parameters further functionality for cross-domain requests. The following query parameters
can be included: can be included:


* path?http-<header-name>=<header-value> - The middleware will translate this to having * path?http-&lt;header-name>=&lt;header-value> - The middleware will translate this to having
a header of the with the specified header name and value. For example, we could emulate a header of the with the specified header name and value. For example, we could emulate
a Accept: application/json with path?http-Accept=application/json a Accept: application/json with path?http-Accept=application/json
* path?http-method=<method-name> - This will be translated to a request with the * path?http-method=&lt;method-name> - This will be translated to a request with the
given HTTP method given HTTP method
* path?http-content=<content> - This will be translated to having the parameter value * path?http-content=&lt;content> - This will be translated to having the parameter value
as the request body. For example, we could emulate a POST with content: path?http-method=POST&http-content=%7B%22some%22%3A%22json%22%7D as the request body. For example, we could emulate a POST with content: path?http-method=POST&http-content=%7B%22some%22%3A%22json%22%7D


### compress ## compress


app = require('pintura/jsgi/compress')(nextApp); app = require('pintura/jsgi/compress')(nextApp);


This module provides gzipping of content. Gzipping can significantly reduce the size This module provides gzipping of content. Gzipping can significantly reduce the size
of responses and improve performance. This module requires the installation of the of responses and improve performance. This module requires the installation of the
"compress" package (npm install compress). "compress" package (npm install compress).


### cascade ## cascade


app = require('pintura/jsgi/cascade')(apps); app = require('pintura/jsgi/cascade')(apps);


Expand All @@ -578,7 +578,7 @@ In this scenario, the request would be first handled by app1. If the response wa
then the response would go to the client. If the response was a 404, then cascade will then the response would go to the client. If the response was a 404, then cascade will
delegate to app2 to handle the request, and so on. delegate to app2 to handle the request, and so on.


### static ## static


app = require('pintura/jsgi/static')({ app = require('pintura/jsgi/static')({
urls: urls, urls: urls,
Expand All @@ -592,15 +592,15 @@ directory specified by the "root" parameter for a file matching the path. The
directoryListing parameter is a boolean indicating whether or not to show directory directoryListing parameter is a boolean indicating whether or not to show directory
listings. listings.


### error ## error


app = require('pintura/jsgi/error')(nextApp); app = require('pintura/jsgi/error')(nextApp);


This module provides error handling, catching JavaScript errors and converting them This module provides error handling, catching JavaScript errors and converting them
to corresponding HTTP error responses. These responses are documented above in to corresponding HTTP error responses. These responses are documented above in
the Error Handling section. the Error Handling section.


### session ## session


app = require('pintura/jsgi/session').Session({ app = require('pintura/jsgi/session').Session({
model: model model: model
Expand All @@ -612,7 +612,7 @@ information. If the optional "model" parameter is provided, the provided model w
used to store the sessions for the application. The Sessions section above for more used to store the sessions for the application. The Sessions section above for more
information on accessing the current session. information on accessing the current session.


### context ## context


app = require('pintura/jsgi/context')(vars, nextApp); app = require('pintura/jsgi/context')(vars, nextApp);


Expand All @@ -631,28 +631,28 @@ and whatever value that was in the variable at the time a promise was created
will be restored when that promise is fulfilled (or rejected). The pintura/jsgi/context module adds a context object to the JSGI request object will be restored when that promise is fulfilled (or rejected). The pintura/jsgi/context module adds a context object to the JSGI request object
that is tied to the promise module. that is tied to the promise module.


### head ## head


app = require('pintura/jsgi/head')(nextApp); app = require('pintura/jsgi/head')(nextApp);


This is a very simple middleware module that adds automatic support for HTTP HEAD This is a very simple middleware module that adds automatic support for HTTP HEAD
requests. This component will convert HEAD requests to a GET request for downstream requests. This component will convert HEAD requests to a GET request for downstream
applications and then strip the response body from the response. applications and then strip the response body from the response.


### cache ## cache


app = require('pintura/jsgi/cache').FetchCache(cache, nextApp); app = require('pintura/jsgi/cache').FetchCache(cache, nextApp);
app = require('pintura/jsgi/cache').UpdateCache(cache, nextApp); app = require('pintura/jsgi/cache').UpdateCache(cache, nextApp);


Provides caching of downstream responses JSGI applications. Provides caching of downstream responses JSGI applications.


### redirect ## redirect


app = require('pintura/jsgi/redirect')(path); app = require('pintura/jsgi/redirect')(path);


Sends a redirect response to the provided path. Sends a redirect response to the provided path.


### pintura-headers ## pintura-headers


app = require('pintura/jsgi/pintura-headers')(serverName, nextApp); app = require('pintura/jsgi/pintura-headers')(serverName, nextApp);


Expand Down

0 comments on commit ddc0d1a

Please sign in to comment.