view 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
line source
1 /* These are the functions that handle the various routes
2 */
4 var fs = require('fs');
5 var errHdlr = function (err) {
6 if( err ) return console.log( "Error writing file: " + err );
7 }
9 exports.saveJSON = function(req, res) {
10 res.send( req.query.json );
11 fs.writeFile('./savedSyntaxGraphs/syntaxGraph.txt', req.query.json, errHdlr);
12 };
14 //fs = require('fs');
15 //fs.writeFile(filename, data, [encoding], [callback])