-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make plugin compatible with Serverless v0.5 #19
Comments
Progress can be followed here: https://github.com/joostfarla/serverless-cors-plugin/tree/v0.4 Big thanks to @ac360! 👍 |
@ac360 upgrade is almost finished and ready for release. However, I'm having one problem with the new way objects can be populated. The endpointDeployPre hook ( |
@joostfarla @ac360 @eahefnawy - Hey, guys! The problem is that the Ideally we need to somehow run the CORS plugin right after Since we don't have hooks between const _validateAndPrepare = S.classes.EndpointDeploy.prototype._validateAndPrepare;
S.classes.EndpointDeploy.prototype._validateAndPrepare = function() {
return _validateAndPrepare.call(this).then(() => {
const cors = new ServerlessCors();
return cors.addPreflightRequests(this.evt);
});
}; What do you think? |
@minibikini thanks for the input! You're right in the fact that the problem occurs because the |
I've already released the new version, but will keep this issue open until we get rid of the warnings. |
One solution could be to let the framework support “partial populations” by passing an array of JSONPath expressions to the |
After thinking about this for a while, I think the most simple and logical solution would be:
This would remove the need to do population from plugins in general. As said before, it's probably unwanted to let plugins populate the environment variables. @ac360 what do you think? |
Just created an issue on the Serverless project (serverless/serverless#1134), which will potentially solve the remaining issue. |
The text was updated successfully, but these errors were encountered: