Commit 70f49343 by Nepxion

去掉Spring Cloud Api Gateway

parent cd02939c
...@@ -59,11 +59,6 @@ ...@@ -59,11 +59,6 @@
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId> <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.nepxion.discovery.plugin.example;
/**
* <p>Title: Nepxion Discovery</p>
* <p>Description: Nepxion Discovery</p>
* <p>Copyright: Copyright (c) 2017-2050</p>
* <p>Company: Nepxion</p>
* @author Haojun Ren
* @version 1.0
*/
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
@EnableDiscoveryClient
public class DiscoveryApplicationGateway {
public static void main(String[] args) {
System.setProperty("spring.profiles.active", "gateway");
new SpringApplicationBuilder(DiscoveryApplicationGateway.class).run(args);
}
@Bean
public RouteLocator routeLocator(RouteLocatorBuilder builder) {
return builder
.routes()
.route(r -> r.path("/iscovery-springcloud-example-a/**").uri("lb://discovery-springcloud-example-a"))
.build();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment