标签:static app ica github仓库 end 图片 端口 imp server
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Greenwich.SR3</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
将项目目录下的/src/main/resources/application.properties文件重命名为application.yml,properties配置格式和yml配置格式是等效的,而yml配置格式能更好的被配置中心使用,所以我们使用yml配置格式。
application.yml配置文件内容修改如下:
server:
port: 9000
spring:
cloud:
gateway:
routes:
- id: first_route
uri: https://github.com/sunweisheng
predicates:
- Path=/test
predicates(还有filters)的种类很多请参考Spring Cloud Gateway官网
访问127.0.0.1:9000/test
Github仓库:https://github.com/sunweisheng/spring-cloud-example
标签:static app ica github仓库 end 图片 端口 imp server
原文地址:https://www.cnblogs.com/bluersw/p/11610705.html