I’m using the VS2022 template: Angular and ASP Core. I have not added any extra code. I’m trying to tweak the ports and settings to make it work in Docker.
It runs perfectly without Docker.
When I create another project using containers:
Everything compiles and runs. It displays in Docker Desktop.
The backend can be tested and works with Swagger.
The frontend loads and runs but does not display the weather data. F12 reveals a Error 500 Internal Server Error.
A breakpoint in the backend is hit when I use Swagger but not hit when I refresh the frontend.
So I think that the frontend can’t see the backend because they’re in containers right?
How do I fix this please? I think there is a variable, a path to the client that VS2022 can predict that is only determined when the container is created. If so how do I set this?
Here is the content of the Proxy.js
2
Answers
This answer is frustrating because I had tried this a few times without success. But I must have been looking at cached data even though I was doing rebuilds. I'm aware Angular does that sometimes but I thought I had handled it. :((
It seems to me that the URL you are sending the request is invalid:
You have an API running on the port 32769:
Port 4200 is reserved for Angular Dev Server (serving static resources)