I have strange issue in API. My backend is created in php and UI in react. in my env file below path are present.
API_URL=http://localhost:8080
FRONT_URL=http://localhost:80
so API_URL is for backend and FRONT_URL is for UI. I have called my API like below in react.
axios
.get(process.env.API_URL+ '/code';)
.then()
.error
my code is working properly. same API I can access from reactas well as postman. there is no issue. But when we deployed our application in UAT URL is appending undefined between API name and API URL. Below are API value in UAT env file.
FRONT_URL=https://uat-solve.dell.com
API_URL=https://api.uat-solve.dell.com
Now my application throwing error. it is not running. when I checked what URL it is trying to reach out then it came below.
https://api.uat-solve.dell.com/undefined/code
It is appending undefined in between. when I tried to access same url from postman after removing undefined output is coming.
What could be the possible reason of it? this is the new component in react. existing application working properly
from strange issue of undefined in url in UAT env. in local it is working
No comments:
Post a Comment