This commit is contained in:
翟永超
2016-07-22 16:33:15 +08:00
parent aaea217048
commit a8a20a76cb
5 changed files with 108 additions and 4 deletions
@@ -0,0 +1,15 @@
package com.didispace;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
@EnableZuulProxy
@SpringCloudApplication
public class Application {
public static void main(String[] args) {
new SpringApplicationBuilder(Application.class).web(true).run(args);
}
}
@@ -0,0 +1,17 @@
spring.application.name=api-gateway
server.port=5555
zuul.ignoredServices="*"
# routes to serviceId
zuul.routes.api-a.path=/api-a/**
zuul.routes.api-a.serviceId=service-A
zuul.routes.api-b.path=/api-b/**
zuul.routes.api-b.serviceId=service-B
# routes to url
zuul.routes.api-a-url.path=/api-a-url/**
zuul.routes.api-a-url.url=http://localhost:2222/
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/