on-internet
← Community

Passing data to handlebars - node.js

Stack Overflow ·

I am new to node.js , so basically I am making a get request in my router(index.js) and then after I get the result (I could see that I obtained the right result by dumping it in console.log) I am parsing it into a json object and passing it to a render function so that I could use it there, however, I am getting errors. I will post the code segments and the JSON fragment below . Is this the right way to use handlebars? Router (index.js) router.get('/getusers', function(req, res) { wrapRequestAsCallback(req.cookies.TOKEN_CACHE_KEY, { onSuccess: function(token) { var all_users = {}; // get all

Comments

Sign in or sign up to comment and upvote.

No comments yet.