添加eureka注册中心支持
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package com.macro.mall;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
|
||||
|
||||
@EnableEurekaServer
|
||||
@SpringBootApplication
|
||||
public class MallRegistryApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MallRegistryApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
13
mall-registry/src/main/resources/application.yml
Normal file
13
mall-registry/src/main/resources/application.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
server:
|
||||
port: 8001
|
||||
spring:
|
||||
application:
|
||||
name: mall-registry
|
||||
eureka:
|
||||
instance:
|
||||
hostname: localhost
|
||||
client:
|
||||
fetch-registry: false
|
||||
register-with-eureka: false
|
||||
server:
|
||||
enable-self-preservation: false
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.macro.mall;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
class MallRegistryApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user