1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

配置Gateway(Gateway不报错,但找不到服务)

This commit is contained in:
2022-11-05 20:25:37 +08:00
parent 40a4d3e8c5
commit ef6467882d
8 changed files with 77 additions and 34 deletions

View File

@@ -1,13 +0,0 @@
package com.cxyxiaomo;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@@ -0,0 +1,12 @@
package com.cxyxiaomo.epp;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Gateway {
public static void main(String[] args) {
SpringApplication.run(Gateway.class, args);
}
}

View File

@@ -0,0 +1,18 @@
server:
port: 80
# Spring 配置
spring:
application:
name: microservice-gateway
cloud:
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
- id: test
uri: lb://microservice-provider-test-8011
predicates:
- Path=/test/**

View File

@@ -1,20 +1,20 @@
package com.cxyxiaomo;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
package com.cxyxiaomo.epp;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class GatewayTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}