Reputation: 101
I have angular app and java backend app running on two different docker containers in a virtual machine on production.
Angular app running on 80 (Exposed to outside world)
Backend app running on 8080 (Not exposed to outside world)
So the angular app is getting data from api's in backend which is running under 8080. Since that port is not exposed, it is unable to access to those api's. But both the apps are running in the same host.
We don't want to expose 8080 to outside, but the angular must be able to access the api's even when I access it from anywhere. Is that possible?
Thanks in advance.
Upvotes: 0
Views: 426
Reputation: 1245
you have to use api gateway (or reverse proxy), so all microservices inluding angular app get accessed on a single port. During development you can configure proxy to serve as a gateway on port 4200 (assuming you use angular-cli and local dev server)
Upvotes: 0