sunneach  committed 026fcc0


  • Participants
  • Parent commits 3acc5a2
  • Branches default

Comments (0)

Files changed (1)

 {{HTTPclientsm.png|HTTP client}}
-The next possible steps are:
+=== Next steps? ===
 # pass the read-only action //read_all// through the GET. For that the client portion of the StickyNotes needs to be slightly updated.
 # add some authentication mechanism to allow different layers of access. 
 # add ETAG generation and analysis to help prevent concurrent content updates.
 # replace the basic "notes" functionality to ...
-=== A bit of Architecture Details ===
+=== More Light ===
-1.  The //priv/dispatch.conf// looks like
+==== JSON - notes ====
+The //priv/dispatch.conf// looks like
 {["notes"], webmstn_dynamic_resource, []}.
 {['*'], webmstn_static_resource, ['PATHTOWWW']}.
-The first line matches only the access path ///notes//, the JSON "notes" exchange will go through the "dynamic" channel. Currently, it accepts only POSTs: the resourve //src/webmstn_dynamic_resource.erl// has only one allowed method:
+The first line matches only the access path ///notes//, 
+the JSON "notes" exchange will go through the "dynamic" channel. 
+Currently, it accepts only POST: the resource //src/webmstn_dynamic_resource.erl// has only one allowed method:
 allowed_methods(RD, Ctx) ->
     {['POST'], RD, Ctx}.
-the static files will be served by the second patter.
+==== Static Files ====
+the static requestsmatch the second row in the //dispatch.conf// and will be served by the //webmstn_static_resource//.
+It only accepts GET and heads. We are using the default interface in the parametrized module 
+//webmachine_resource//, so there is no need to write our own version:
+%% in the deps/webmachine/webmachine_resource.erl
+default(allowed_methods) ->
+    ['GET', 'HEAD'];
-=== What is inside ===
+==== The Test Home Page ====
 The http://localhost:8000 is now pointing to a small client page //priv/www/index.html// which allows you to 
   * explicitly enter JSON, 
 $ hg clone
-Wiki pages are normal files, with the .wiki extension. You can edit them locally, as well as creating new ones.
-=== Syntax highlighting ===
-You can also highlight snippets of text, we use the excellent [[|Pygments]] library.
-Here's an example of some Python code:
-def wiki_rocks(text):
-	formatter = lambda t: "funky"+t
-	return formatter(text)
-You can check out the source of this page to see how that's done, and make sure to bookmark [[|the vast library of Pygment lexers]], we accept the 'short name' or the 'mimetype' of anything in there.
-Have fun!