Add Post option to simple persist to be able to simulate "Save Once" which uses Post request
authorrougeronj
Sun, 04 Jan 2015 21:58:52 +0100
changeset 355 fa39654e7084
parent 354 554129dbdbd0
child 356 763c925e7a9c
Add Post option to simple persist to be able to simulate "Save Once" which uses Post request
client/data/simple-persist.js
--- a/client/data/simple-persist.js	Mon Dec 29 17:24:11 2014 +0100
+++ b/client/data/simple-persist.js	Sun Jan 04 21:58:52 2015 +0100
@@ -15,7 +15,7 @@
     res.setHeader('Content-Type', 'application/json; charset=utf-8');
     res.statusCode = 200;
 
-    if(req.method === "PUT") {
+    if(req.method === "PUT" || req.method === "POST") {
       req.pipe(fs.createWriteStream(jsonFile));
       res.end(JSON.stringify({result: "OK"}));
     }