在guli_parent下创建普通maven模块
Artifact:infrastructure
在infrastructure下创建普通maven模块
Artifact:api_gateway
在api_gateway的pom中添加如下依赖
<dependencies>
<!-- 网关 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
</dependencies>
server:
port: 9110 # 服务端口
spring:
profiles:
active: dev # 环境设置
application:
name: infrastructure-apigateway # 服务名
修改日志输出的目录名为 apigateway
<property name="log.path" value="D:/project/helen/guli_log/apigateway" />
package com.atguigu.guli.infrastructure.apigateway;
@SpringBootApplication
public class InfrastructureApiGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(InfrastructureApiGatewayApplication.class, args);
}
}
原文:https://www.cnblogs.com/smalldong/p/13911187.html