sails: async controller fails to bind to routes

BEGIN VERSION INFO

–> Sails version: 0.12.7 Node version: 7.0.0 NPM version: 3.10.8 Operating system: macOS Sierra

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 26 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@mikermcneil Waiting for the fix

Making the controller function async makes it possible to await the Promises inside the controller. So I can avoid callbacks and promise then chains:

let item = await Items.findOne(req.params.id); // then do something with item

instead of

Items.findOne(req.params.id)
.then(function(item){
})
// and the chain continues