var task = new Task(req.body);
task.save(function(err){
if (err){
//
} else {
//
}
});
var fs = require('fs');
var data = null;
if (fs.existsSync(path)) {
// Read from file
var data = JSON.parse(fs.readFileSync(path, 'utf8'));
} else {
// Create your file and put data there
data = someJsonData;
var json = JSON.stringify(data);
fs.writeFile(path, json, 'utf8', callback);
}
That said, Google does not seem to be able to index any content that requires a click. So if you are concerned about your AngularJS SEO, you should make sure that all content which you want to get indexed is visible on page load.