What is a Gateway API? It's a one-stop facade where we can make all our various web requests. The facade then dispatches the requests to the proper backend service based on the configuration settings.
In our case, we don't want the browser talking to two different ports. Instead, we'd rather serve up a single, unified service with different URL paths.
In Chapter 16, Microservices with Spring Boot, we used Spring Cloud for several microservice tasks, including service discovery, circuit breaker, and load balancing. Another microservice-based tool we will make use of is Spring Cloud Gateway, a tool for building just such a proxy service.
Let's start by adding this to our chat microservice:
compile('org.springframework.cloud:spring-cloud-starter-gateway') ...