Closed Borfswitch closed 8 years ago
@Borfswitch thanks for reporting!
This is done intentionally because multiple functions with different HTTP methods can share the same path. The question I was struggling with was: If one of x functions with the same path is being deployed, should it deploy the preflight endpoint for all methods?
Any thoughts on this?
@joostfarla, I think it would be nice if there was some way to specify which endpoints within a function should have CORS enabled, rather than just applying it to all endpoints within a function.
Are there plans to document the usage of the --all
flag?
It also might be nice to have something like a --cors
flag that would deploy the preflight endpoints only for the function(s) currently being deployed, so that you aren't forced to always use --all
.
Most edge cases can be solved by making proper use of templates & variables. The use of the --all
flag has already been documented , so I will close this issue.
The OPTIONS endpoints are not being deployed by default. I figured out by looking at the plugin source code that you need to add a
--all
flag to the command to get the OPTIONS endpoints to deploy.