JavaScript runs on the client side, so it cannot resolve internal Kubernetes pod names. Therefore, you cannot use the pod name directly as the backend URL.
In the development environment, ensure you use localhost instead of the Kubernetes pod name.
For production, make sure the backend URL is externally accessible to allow the client to communicate with it.