1、pom.xml与上篇一致
2、新建包及Application启动类
@Configuration@ComponentScan@EnableEurekaClient@EnableAutoConfiguration@RestControllerpublic class Application {@RequestMapping(value = "hello",method = RequestMethod.GET)public String hello(){return "你好,世界";}public static void main(String[] args){new SpringApplicationBuilder(Application.class).web(true).run(args);}}
3、新建application.yml配置文件(我们尝试两种不同的配置)
eureka:client:serviceUrl:defaultZone: http://localhost:1000/eureka/
eureka:client:serviceUrl:defaultZone: http://localhost:1000/eureka/spring:application:name: client-service1server:port: 2000
4、运行,查看之前Erueka服务端的页面
