开放Spring Cloud Eureka API

一般来说,Eureka 默认提供了一套 UI 界面,但在大多数情况下,由于 UI 风格问题并不适合直接嵌入到业务系统中使用;

本文通过扩展 Eureka 项目,实现相关的自定义接口,以便业务系统集成调用;

1. Eureka Project;

1
2
3
4
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
1
2
3
4
5
6
7
8
@EnableEurekaServer
@SpringBootApplication(scanBasePackages = "com.fastjee")
public class FastjeeEurekaApplication {

public static void main(String[] args) {
FastjeeApplication.run(FastjeeEurekaApplication.class, args);
}
}

2. RESTful API

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×