ApiGateway pom.xml
ApiGateway pom.xml
Код: Выделить всё
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.5.3
com.futurex.microservices
APIGateway
0.0.1-SNAPSHOT
APIGateway
Demo project for Spring Boot
1.8
2020.0.3
org.springframework.cloud
spring-cloud-starter-gateway
org.springframework.cloud
spring-cloud-starter-netflix-eureka-client
org.springframework.boot
spring-boot-starter-actuator
org.springframework.boot
spring-boot-starter-test
test
org.springframework.cloud
spring-cloud-dependencies
${spring-cloud.version}
pom
import
org.springframework.boot
spring-boot-maven-plugin
Код: Выделить всё
spring:
application:
name: API-GATEWAY
cloud:
gateway:
routes:
- id: FX-SERVICE1
uri: http://localhost:8005
predicates:
- Path=/fx-service1/**
- id: FX-SERVICE2
uri: http://localhost:8006
predicates:
- Path=/fx-service2/**
discovery:
enabled: true
config:
uri: http://localhost:8081
server:
port: 8081
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
register-with-eureka: true
fetch-registry: true
instance:
hostname: localhost
Код: Выделить всё
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
public class ApiGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(ApiGatewayApplication.class, args);
}
}
Подробнее здесь: https://stackoverflow.com/questions/686 ... -404-error
Мобильная версия