Mercurial > cgi-bin > hgwebdir.cgi > POP > oldRepo
comparison 1__Development/6__Website/POPExpressServer/routes/saveJSON.js @ 5:e73fbbcb5fd2
Persisting basic graph works, starting to add persist of view hierarchy too
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Sun, 03 Aug 2014 23:38:15 -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 |
