Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/', function(req, res) {
- //res.write(json); is good but we need to call res.end() to end the response
- //what i really should have done is this:
- res.writeHead(200, {"Content-Type": "application/json"}); // not sure if this line is needed!
- res.end(json);
- // res.end(json); is equal to: res.write(json); res.end();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement