File tree Expand file tree Collapse file tree 4 files changed +80
-0
lines changed
labx-14-sc-skywalking-springcloudgateway
java/cn/iocoder/springcloud/labx14/gatewaydemo Expand file tree Collapse file tree 4 files changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
+ <parent >
6
+ <artifactId >labx-08</artifactId >
7
+ <groupId >cn.iocoder.springboot.labs</groupId >
8
+ <version >1.0-SNAPSHOT</version >
9
+ </parent >
10
+ <modelVersion >4.0.0</modelVersion >
11
+
12
+ <artifactId >labx-14-sc-skywalking-springcloudgateway</artifactId >
13
+
14
+ <properties >
15
+ <spring .boot.version>2.1.13.RELEASE</spring .boot.version>
16
+ <spring .cloud.version>Greenwich.SR1</spring .cloud.version>
17
+ </properties >
18
+
19
+ <!--
20
+ 引入 Spring Boot、Spring Cloud、Spring Cloud Alibaba 三者 BOM 文件,进行依赖版本的管理,防止不兼容。
21
+ 在 https://dwz.cn/mcLIfNKt 文章中,Spring Cloud Alibaba 开发团队推荐了三者的依赖关系
22
+ -->
23
+ <dependencyManagement >
24
+ <dependencies >
25
+ <dependency >
26
+ <groupId >org.springframework.boot</groupId >
27
+ <artifactId >spring-boot-starter-parent</artifactId >
28
+ <version >${spring.boot.version} </version >
29
+ <type >pom</type >
30
+ <scope >import</scope >
31
+ </dependency >
32
+ <dependency >
33
+ <groupId >org.springframework.cloud</groupId >
34
+ <artifactId >spring-cloud-dependencies</artifactId >
35
+ <version >${spring.cloud.version} </version >
36
+ <type >pom</type >
37
+ <scope >import</scope >
38
+ </dependency >
39
+ </dependencies >
40
+ </dependencyManagement >
41
+
42
+ <dependencies >
43
+ <!-- 引入 Spring Cloud Gateway 相关依赖,使用它作为网关,并实现对其的自动配置 -->
44
+ <dependency >
45
+ <groupId >org.springframework.cloud</groupId >
46
+ <artifactId >spring-cloud-starter-gateway</artifactId >
47
+ </dependency >
48
+ </dependencies >
49
+
50
+ </project >
Original file line number Diff line number Diff line change
1
+ package cn .iocoder .springcloud .labx14 .gatewaydemo ;
2
+
3
+ import org .springframework .boot .SpringApplication ;
4
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+
6
+ @ SpringBootApplication
7
+ public class GatewayApplication {
8
+
9
+ public static void main (String [] args ) {
10
+ SpringApplication .run (GatewayApplication .class , args );
11
+ }
12
+
13
+ }
Original file line number Diff line number Diff line change
1
+ server :
2
+ port : 8888
3
+
4
+ spring :
5
+ application :
6
+ name : gateway-application
7
+
8
+ cloud :
9
+ # Spring Cloud Gateway 配置项,对应 GatewayProperties 类
10
+ gateway :
11
+ # 路由配置项,对应 RouteDefinition 数组
12
+ routes :
13
+ - id : feign-service-route
14
+ uri : http://127.0.0.1:8081
15
+ predicates :
16
+ - Path=/**
Original file line number Diff line number Diff line change 14
14
<modules >
15
15
<module >labx-14-sc-skywalking-springmvc</module >
16
16
<module >labx-14-sc-skywalking-feign</module >
17
+ <module >labx-14-sc-skywalking-springcloudgateway</module >
17
18
</modules >
18
19
19
20
</project >
You can’t perform that action at this time.
0 commit comments