Created
January 27, 2016 06:16
-
-
Save h4n2k/d20c59a07fb2cde279a6 to your computer and use it in GitHub Desktop.
Sails.js with bluebird Cannot read property 'then' of undefined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(req, res, next) { | |
var pack = { | |
params: req.params.all(), | |
headers: req.headers, | |
user: req.user | |
}; | |
var promise = sails.bluebird.resolve(pack); | |
req.promise = promise; | |
next(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sending 500 ("Server Error") response: | |
TypeError: Cannot read property 'then' of undefined | |
----------------------------------------------------------------------- | |
api/policies | |
promisifyReq.js | |
config/policies | |
'*': ['promisifyReq'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment