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
- Apply patch for https://github.com/lodash/lodash/issues/2768 and https://github.com/balderdashy/sails/issues/3863 — committed to sailshq/lodash by mikermcneil 8 years ago
- Remove individual per-method lodash deps (this is already done on v1.0, just backportin') — committed to balderdashy/sails by mikermcneil 8 years ago
- pesky little bugger — committed to balderdashy/sails by mikermcneil 8 years ago
@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 iteminstead of