Share via

Angular front-end deployed in Azure can't connect to back-end API, the api url is spliced

Wenbo Peng 0 Reputation points
2024-10-10T06:48:21.7433333+00:00

Hello there,

I have deployed Spring boot backend and Angular frontend website in Azure, when I access the website, for some reason the frontend url is spliced in front of the api url causing me to be unable to access it. My local development environment is all fine.

As shown below, Brower got the wrong API URL https://ambitious-ground-04bd38a0f.5.azurestaticapps.net/ecommercespring-g7guhdcvf2gjgrd6.canadaeast-01.azurewebsites. net/api/product-category

My correct API URL should be https://ecommercespring-g7guhdcvf2gjgrd6.canadaeast-01.azurewebsites.net/api

And I don't think I have a problem with Angular's Cors.

Thank you

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

Azure Static Web Apps
Azure Static Web Apps

An Azure service that provides streamlined full-stack web app development.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.