diff --git a/eureka-server/pom.xml b/eureka-server/pom.xml new file mode 100644 index 0000000..1053318 --- /dev/null +++ b/eureka-server/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + cn.hezhaohui + eureka-server + 1.0-SNAPSHOT + + + cn.hezhaohui + spring-cloud-template + 1.0-SNAPSHOT + + + + 21 + 21 + UTF-8 + + + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-server + + + + org.springframework.boot + spring-boot-starter-test + test + + + + \ No newline at end of file diff --git a/eureka-server/src/main/java/cn/hezhaohui/eurekaserver/EurekaServerApplication.java b/eureka-server/src/main/java/cn/hezhaohui/eurekaserver/EurekaServerApplication.java new file mode 100644 index 0000000..ffe9870 --- /dev/null +++ b/eureka-server/src/main/java/cn/hezhaohui/eurekaserver/EurekaServerApplication.java @@ -0,0 +1,14 @@ +package cn.hezhaohui.eurekaserver; + + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; + +@SpringBootApplication +@EnableEurekaServer +public class EurekaServerApplication { + public static void main(String[] args) { + SpringApplication.run(EurekaServerApplication.class, args); + } +} diff --git a/eureka-server/src/main/resources/application.yml b/eureka-server/src/main/resources/application.yml new file mode 100644 index 0000000..34aa40f --- /dev/null +++ b/eureka-server/src/main/resources/application.yml @@ -0,0 +1,15 @@ +server: + port: 8761 + +spring: + application: + name: eureka-server + +eureka: + instance: + hostname: localhost + client: + register-with-eureka: false + fetch-registry: false + service-url: + defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ \ No newline at end of file diff --git a/eureka-server/src/test/java/cn/hezhaohui/eurekaserver/EurekaServerApplicationTest.java b/eureka-server/src/test/java/cn/hezhaohui/eurekaserver/EurekaServerApplicationTest.java new file mode 100644 index 0000000..a98f688 --- /dev/null +++ b/eureka-server/src/test/java/cn/hezhaohui/eurekaserver/EurekaServerApplicationTest.java @@ -0,0 +1,14 @@ +package cn.hezhaohui.eurekaserver; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class EurekaServerApplicationTest { + + @Test + void contextLoads() { + + } + +} \ No newline at end of file