0
votes

When I call my AWS API Gateway from a JavaScript client I get a 404 not found error because the SDK invokes the wrong endpoint:

Instead of

It was fine yesterday. Someone can explain the cause?

UPDATE!

In axios.standalone.js a Microsoft.XMLHTTP ActiveX object is created to send the request. The data parameter has a url member set to "https:abc123.execute-api.us-east-1.amazonaws.com/dev/status". Note there is no slash slash at the beginning. The base URL of the JavaScript client is inserted into the request URL. Please help!

2
My JavaScript client resides on my server (for example myserver.com) - rjobidon

2 Answers

1
votes

There was an issue with the JS SDK generator that has been fixed recently. Please update your JS SDK with a newly generated version.

Best, Jurgen

0
votes

Modify axios.standalone.js

module.exports = function xhrAdapter(resolve, reject, config) {

      // Temporary fix for missing // in config.url 
      if ((config.url.substr(0, 6) == "https:") && (config.url.substr(0, 8) != "https://")) {     
        config.url = "https://" + config.url.substr(6, config.url.length - 6);
      }

...