diff --git a/api-gateway/pom.xml b/api-gateway/pom.xml
new file mode 100644
index 0000000..a137e5f
--- /dev/null
+++ b/api-gateway/pom.xml
@@ -0,0 +1,47 @@
+
+
+ 4.0.0
+
+ cn.hezhaohui
+ spring-cloud-template
+ 1.0-SNAPSHOT
+
+
+ api-gateway
+
+
+ 21
+ 21
+ UTF-8
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-netflix-eureka-client
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-loadbalancer
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-gateway
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-bootstrap
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-config
+
+
+
+
\ No newline at end of file
diff --git a/api-gateway/src/main/java/cn/hezhaohui/apigateway/GatewayApplication.java b/api-gateway/src/main/java/cn/hezhaohui/apigateway/GatewayApplication.java
new file mode 100644
index 0000000..4c81612
--- /dev/null
+++ b/api-gateway/src/main/java/cn/hezhaohui/apigateway/GatewayApplication.java
@@ -0,0 +1,13 @@
+package cn.hezhaohui.apigateway;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+
+@SpringBootApplication
+@EnableDiscoveryClient
+public class GatewayApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(GatewayApplication.class, args);
+ }
+}
diff --git a/api-gateway/src/main/resources/bootstrap.yml b/api-gateway/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..2e9e19e
--- /dev/null
+++ b/api-gateway/src/main/resources/bootstrap.yml
@@ -0,0 +1,11 @@
+spring:
+ application:
+ name: api-gateway
+ cloud:
+ config:
+ uri: http://localhost:8888
+ fail-fast: true
+eureka:
+ client:
+ service-url:
+ defaultZone: http://localhost:8761/eureka/
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 986fcc4..85acc9d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,6 +15,7 @@
config-server
service-producer
service-consumer
+ api-gateway
@@ -28,7 +29,7 @@
org.springframework.boot
spring-boot-starter-parent
- 3.2.2
+ 3.3.13
pom
import
diff --git a/service-producer/pom.xml b/service-producer/pom.xml
index 4ede68f..c4ed573 100644
--- a/service-producer/pom.xml
+++ b/service-producer/pom.xml
@@ -28,6 +28,11 @@
spring-cloud-netflix-eureka-client
+
+ org.springframework.cloud
+ spring-cloud-starter-loadbalancer
+
+
org.springframework.cloud
spring-cloud-starter-config