I\'m a newb to back-end code and I\'m trying to create a function that will respond to me a JSON string. I currently have this from an example
function rando
Per JamieL's answer to another post:
Since Express.js 3x the response object has a json() method which sets all the headers correctly for you. Example: res.json({"foo": "bar"});
Since Express.js 3x the response object has a json() method which sets all the headers correctly for you.
Example:
res.json({"foo": "bar"});