We are currently using a serverless deployment model for our NodeJS codebase API. Everything was fine until we came across a hard limit for CloudFormation stacks created by a server without a server that has a limited resource limit of 200.
Trying to get around this while the Serverless team is working on nested stack integration was replacing GET, PUT, POST, DELETE for the same route with ANY, which saved us about 75% in CloudFormation resources.
The Gateway API seems to have done a good job of this; the integration response for the OPTIONS route returned Access-Control-Allow-Methods: 'OPTIONS,ANY'.
Testing this with the postman worked like a charm, being able to use all the previously mentioned methods without a hitch.
Doing this from our Angular frontend does not seem to work.
XMLHttpRequest cannot load. The PUT method is not allowed by the Access-Control-Allow-Methods methods in the preflight response.
In Angular, the eyes, POST, PUT, DELETE, ... do not match ANY, but for the postman it does.
Any reasons why this might happen are welcome.
UPDATE
The POST request works through the Angular application, only PUT and DELETE requests throw an error "not allowed using Access-Control-Allow-Methods".
source
share