Breakpoint debugger for sails.js
I am trying and unable to get basic breakpoints working in a new sails sails application.
I am creating a new sail project called test and added a couple of lines of code so that I can hit the route and try to start a breakpoint in my terminal:
// app/controllers/TestController.js
module.exports = {
test: function (req, res) {
console.log('test');
debugger;
return res.json({
text: 'hello',
});
}
}
in the routes file:
// /config/routes.js
'get /test': 'TestController.test',
then I go to my terminal and use nodemon to start the sails server with:
$ nodemon debug -w . app.js
My one caveat is that this solution should work with something like nodemon, forever or overseer, which will allow the reneload function on the server node
+3
source to share
No one has answered this question yet
Check out similar questions: