Setting up a new Zuul API Gateway Server

We will use Spring Initializr (http://start.spring.io) to set up a new project for Zuul API Gateway. The following screenshot shows the GroupId, ArtifactId, and Dependencies to be selected:

The next step is to enable Zuul proxy on the Spring Boot application. This is done by adding the @EnableZuulProxy annotation on the ZuulApiGatewayServerApplication class. The following snippet shows the details:

    @EnableZuulProxy    @EnableDiscoveryClient    @SpringBootApplication    public class ZuulApiGatewayServerApplication {

We will run Zuul Proxy on port 8765. The following snippet shows the configuration needed in ...

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.