Mercurial > cgi-bin > hgwebdir.cgi > POP > oldRepo
comparison 1__Development/6__Website/POPExpressServer/routes/saveJSON.js @ 8:cc10d99e3f83
Persist and read back from disk and parse to objects is working.. Display needs updating now
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Sat, 09 Aug 2014 03:34:26 -0700 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:b7837ed93fbd |
|---|---|
| 1 /* These are the functions that handle the various routes | |
| 2 */ | |
| 3 | |
| 4 var fs = require('fs'); | |
| 5 var errHdlr = function (err) { | |
| 6 if( err ) return console.log( "Error writing file: " + err ); | |
| 7 } | |
| 8 | |
| 9 exports.saveJSON = function(req, res) { | |
| 10 res.send( req.query.json ); | |
| 11 fs.writeFile('./savedSyntaxGraphs/syntaxGraph.txt', req.query.json, errHdlr); | |
| 12 }; | |
| 13 | |
| 14 //fs = require('fs'); | |
| 15 //fs.writeFile(filename, data, [encoding], [callback]) | |
| 16 |
