cancel
Showing results for 
Search instead for 
Did you mean: 

xs-app.json configuration not working

SnehalD
Explorer
0 Kudos

I have created an application to connect to Demo SOAP API.

I have configured xs-app.json as follows:

"routes": [ { "source": "^/csp/(.*)$", "target": "/$1", "destination": "SOAP" } ]

But still system the system is unable to understand the destination.

Kindly let me know if I am missing anything here or this configuration is uncomplete.

drvup
Contributor
0 Kudos

Hi,

can you share with us the destination-configuration. I am really sure your xs-app.json has leading and closing brackets, right 😉 ?

SnehalD
Explorer
0 Kudos

Hi Cedric,

Below is the destination configuration in BTP cockpit:

And yes, xs-app.json has leading and closing brackets.

{ "welcomeFile": "/index.html", "authenticationMethod": "none", "routes": [ { "source": "^/csp/(.*)$", "target": "/$1", "destination": "SOAP" } ] }

I had removed target also and tried to run the application, but still I am getting 404 error code.

View Entire Topic
mariusobert
Developer Advocate
Developer Advocate
0 Kudos

What is the exact error message that you're seeing? 404 could also mean that the route worked but the destination crcind.com returns 404.

Or is the approuter crashing on startup? In this case, the error log would be helpful.

SnehalD
Explorer
0 Kudos

Hi Marius,

I have checked the connection to crcind.com from BTP cockpit and it returns 200 Ok Response.

Below is the error log:

You can see from the error log that it is not hitting correct URL which starts with crcind.com.

mariusobert
Developer Advocate
Developer Advocate
0 Kudos

Redirecting requests is not the purpose of the approuter. It just proxies requests for you. This means you'll never see a URL that start with crcind.com in here.

I wouldn't necessarily rely on the 200 you saw in the cockpit. Have a look at this video to see how you can make sure the destination is set up properly.