我的项目结构如图,我配置了网关模块,但是毫无作用
package com.bulldozer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@EnableDiscoveryClient
@SpringBootApplication
public class BulldozerGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(BulldozerGatewayApplication.class, args);
}
}
bootstrap.yml文件
server:
port: 9093
spring:
application:
name: springcloud-gateway-service
cloud:
config:
discovery:
enabled: true
service-id: config-server
profile: dev
label: master
gateway:
enabled: true #开启网关
discovery:
locator:
enabled: true #开启自动路由,以服务id建立路由,服务id默认大写
lower-case-service-id: true #服务id设置为小写
eureka:
client:
service-url:
defaultZone: http://localhost:9001/eureka/