In dev server, all api urls are working fine. But when I am using “vite build” and running the server, the frontend url are appending in front of backend url.
For example –
frontend server is serving at 192.168.4.139:3000
the backend server is let’s say – example-backend.com
I checked from network tab and the application is supposed to call the api http://example-backend.com/login, but it’s becoming
http://192.168.4.139:3000/example-backend.com/login
It does not happen in dev server. but when I build the frontend using “vite build” and serve the application, the api urls starts to appear like this.
I am expecting the api url should be http://example-backend.com/login but it’s becoming http://192.168.4.139:3000/example-backend.com/login