0

I am using spring boot version 1.5.10.RELEASE. I have developed on service using spring boot and used Eureka service register, Zuul API Gateway. My applications pom file application name is "TestApplication"

<build>
    <finalName>TestApplication</finalName>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

And tomcat deployed war name is "testservice.war".

So when I access the URL of application using API Gateway it is formed like below

http://localhost:8080/ApiGateway/testapplication/testservice/swagger-ui.html

format: zuul api gateway context/ applicationname/contextname

I want to avoid context name (testservice) in the url and access with eureka registered name only like below:

http://localhost:8080/ApiGateway/testservice/swagger-ui.html
James Z
  • 12,209
  • 10
  • 24
  • 44
Coder Guru
  • 513
  • 3
  • 18
  • 37

1 Answers1

0

You can add a route to Zuul .properties file, something like :

zuul.routes.testapplication.path=/testapplication
zuul.routes.testapplication.service-id=testapplication

Then you can call your service like this : http://APIGATEWAY:8080/testapplication/swagger-ui.html/

redoff
  • 1,124
  • 11
  • 18