Skip to content
This repository
Browse code

More docs

  • Loading branch information...
commit cd82c1b0d217544bd4c1dfd660ab5e0a6373d1aa 1 parent e029f51
Kris Zyp authored December 09, 2011

Showing 1 changed file with 37 additions and 2 deletions. Show diff stats Hide diff stats

  1. 39  README.md
39  README.md
Source Rendered
@@ -379,7 +379,7 @@ However, the module also allows you to create new security objects.
379 379
 
380 380
 This is a constructor that creates a new security object.
381 381
 
382  
-## media
  382
+## media (module)
383 383
 
384 384
 This module is responsible for handling content negotiation, determining the appropriate
385 385
 media deserialization or renderer for a given content type or requested content type, by
@@ -389,7 +389,7 @@ This module provides a constructor for creating new media handlers that will be
389 389
 for the content negotiation process. This constructor is described in the "Content Negotiation"
390 390
 section above.
391 391
 
392  
-## media
  392
+## media (folder)
393 393
 
394 394
 This folder contains modules that implement various media types. These media
395 395
 types can deserialize raw content to objects and serialize objects to raw content. These
@@ -416,6 +416,41 @@ for handling forms with file uploads
416 416
 in JSON format. This can be used for triggering a series of actions in a single request.
417 417
 This is described in more detail above in the Bulk Updates section.
418 418
  
  419
+## jsgi
  420
+
  421
+The jsgi folder contains the set of JSGI middleware components that comprise Pintura.
  422
+
  423
+### auth
  424
+
  425
+The auth module handles HTTP authorization, performing the HTTP request side of user 
  426
+authentication and calling the security module to perform the authentication and determine the authorization of
  427
+the user. This module will set the "remoteUser" property on the request and the "currentUser"
  428
+property on the promise context if a user is authenticated.
  429
+
  430
+
  431
+### rest-store
  432
+
  433
+This module delegates the HTTP REST requests to the appropriate data model. This
  434
+component will call the method on the model corresponding the request method name 
  435
+(converted to lowercase), so a PUT request will result in a model.put() call. The model
  436
+is determined by the path of the request before the first slash. The first argument provided
  437
+to the call will be the path for the requests without a body, and the body for requests
  438
+with a body. The second argument is an object with the headers and the path as the "id"
  439
+property.
  440
+
  441
+This component will alternately call the query() method if the request is a GET with a 
  442
+query string. It will also handle the Range header, converting it to an appropriate limit()
  443
+parameter in the query string.
  444
+
  445
+### media
  446
+
  447
+This component processes the HTTP content negotiation headers, calling the pintura/media
  448
+module to perform content negotiation. This handles the request body deserialization
  449
+and response body serialization. The upstream middleware/apps can expect the request.body
  450
+value to be a deserialized object (for example, JSON would be parsed), and can return
  451
+an object, array, or other value in the response.body and this middleware component
  452
+will serialize it based on the client's preferred media type (defined in the Accept header).
  453
+ 
419 454
 ### Homepage:
420 455
 
421 456
 * [http://persvr.org/](http://persvr.org/)

0 notes on commit cd82c1b

Please sign in to comment.
Something went wrong with that request. Please try again.