RESTful routes js file:
// index route - show all todos
router.get(\"/\", middleware.isLoggedIn,function(req,res) {
Todo.find({ \"author.id\" : req.user._i
By formatting the html printing of the JSON you get from the server and using javascript (my case jQuery) to retrieve that text, store it, and remove it from the html :)
EJS:
<%= JSON.stringify(passedInEjsVariable); %>
JavaScript:
var variableJSON = JSON.parse($('#variableJSON').text());
$('#variableJSON').remove();