javascript - Node.js: "Can't set headers after they are sent" error -
here code:
github.repos.getcontent({ user: "user", repo: "repo", path: "path" }, function(err, res) { var content = err; console.log(err, res); }); response.json({ message: 'got content! ' + content}); });
that github command outputs content of file, , manipulate content. however, either says "can't set headers after sent" if put inside function(err,res) part, or says var content hasn't been made yet if outside. how use output , manipulate it?
Comments
Post a Comment