react
This commit is contained in:
4
server/eureka/build.gradle
Normal file
4
server/eureka/build.gradle
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server'
|
||||
}
|
||||
15
server/eureka/src/main/java/bit/space/EurekaApplication.java
Normal file
15
server/eureka/src/main/java/bit/space/EurekaApplication.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package bit.space;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableEurekaServer
|
||||
public class EurekaApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(EurekaApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
11
server/eureka/src/main/resources/application.yml
Normal file
11
server/eureka/src/main/resources/application.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
server:
|
||||
port: 8761
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: eureka-server
|
||||
|
||||
eureka:
|
||||
client:
|
||||
register-with-eureka: false
|
||||
fetch-registry: false
|
||||
5
server/gateway/build.gradle
Normal file
5
server/gateway/build.gradle
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
|
||||
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package bit.space;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class GatewayApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GatewayApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
26
server/gateway/src/main/resources/application.yml
Normal file
26
server/gateway/src/main/resources/application.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
server:
|
||||
port: 10000
|
||||
|
||||
eureka:
|
||||
client:
|
||||
register-with-eureka: true
|
||||
fetch-registry: true
|
||||
service-url:
|
||||
defalutZone: http://localhost:8761/eureka
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: gateway-server
|
||||
cloud:
|
||||
gateway:
|
||||
routes:
|
||||
- id: member-service
|
||||
uri: lb://MEMBER-SERVICE
|
||||
predicates:
|
||||
- Path=/member-service/**
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health, info, metrics, prometheus, gateway
|
||||
Reference in New Issue
Block a user