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

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -