在localhost上运行服务:8000。我使用Spring Gateway路由到它,只得到一个白色页面,而不是服务的登录页面。
我尝试过使用java进行路由,也尝试过通过yml文件进行路由。
Java
@SpringBootApplication
public class GsGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GsGatewayApplication.class, args);
}
@Bean
public RouteLocator myRoutes(RouteLocatorBuilder builder){
return builder.routes()
.route(p->p
.path("/get")
.uri("localhost:8000/login"))
.build();
}
}application.yml
server:
port: 8080
spring:
application:
name: api-gateway
cloud:
gateway:
routes:
- id: weblogin
uri: localhost:8000/login
predicates:
- Path=/get我希望有一个登录页面,但只得到一个空白的白色页面。
发布于 2019-10-29 17:16:16
根据您的配置,当您访问localhost/get时,您将被路由到localhost:8080/get
https://stackoverflow.com/questions/58105169
复制相似问题