I am trying to send a JSON object back to my client using a websites API and am getting the following error.
var body = JSON.stringify(obj, replacer, spaces);
TypeError: Converting circular structure to JSON
at Object,stringify (native)
Here is my code
app.get('/api/test', function(req, res){
http.get('http://api.biblia.com/v1/bible/content/LEB.txt.json?passage=John3.16&key=fd37d8f28e95d3be8cb4fbc37e15e18e', function(data) {
res.json(data);
});
});
If I replace data
with a simple JSON object {"test":"test"}. Everything works fine. Any help with understanding what is even occuring would be helpful. I am using an Express.js Node.js Angular.js stack. Thank you!