Skip to content

Instantly share code, notes, and snippets.

@h4n2k
Created January 27, 2016 06:16
Show Gist options
  • Save h4n2k/d20c59a07fb2cde279a6 to your computer and use it in GitHub Desktop.
Save h4n2k/d20c59a07fb2cde279a6 to your computer and use it in GitHub Desktop.
Sails.js with bluebird Cannot read property 'then' of undefined
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();
};
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