22 lines
602 B
Java
22 lines
602 B
Java
|
package ocean.gateway.service.routes;
|
||
|
|
||
|
import org.springframework.boot.SpringBootConfiguration;
|
||
|
import org.springframework.cloud.gateway.route.RouteLocator;
|
||
|
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
|
||
|
import org.springframework.context.annotation.Bean;
|
||
|
|
||
|
import lombok.extern.slf4j.Slf4j;
|
||
|
|
||
|
@Slf4j
|
||
|
@SpringBootConfiguration
|
||
|
public class Business {
|
||
|
@Bean
|
||
|
public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
|
||
|
log.warn("path_route");
|
||
|
return builder.routes().route("path_route", r -> r.path("/hello").uri("http://localhost:3030/hello")).build();
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|