Simpler POST
authorTomas Zeman <tzeman@volny.cz>
Sat, 14 Dec 2013 21:48:08 +0100
changeset 2 26148011541f
parent 1 411d80fcd66c
child 3 0fa2f12fcb3c
Simpler POST
.hgignore
server.coffee
--- a/.hgignore	Sat Dec 14 21:40:24 2013 +0100
+++ b/.hgignore	Sat Dec 14 21:48:08 2013 +0100
@@ -1,1 +1,2 @@
 node_modules
+package.js
--- a/server.coffee	Sat Dec 14 21:40:24 2013 +0100
+++ b/server.coffee	Sat Dec 14 21:48:08 2013 +0100
@@ -20,16 +20,16 @@
       response: rs
   }
   'post': Apps.Method {
-    'POST': new Apps.Chain().use(Apps.JsonRequest).use(() => (o, rq, rs) => {
+    'POST': Apps.JsonRequest((o, rq, rs) => {
       status: 200
       headers: {}
       data:
-        post: o
+        data: o
         request:
           path: rq.path
           pathInfo: rq.pathInfo
         response: rs
-    }).end()
+    })
   }, Apps.methodNotAllowed
 }