网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

springboot2.x搭建springcloud

时间:2024-10-15 21:30:14

1、创建eurka注册中心。主要代码如下所示。在默认设置下,该服务注册中心也会将自己作为客户端来尝试注册它自己,所以我们需要禁用它的客户端注册行为,只需要在application.properties中问增加如下配置.启动项目访问localhost:9000

springboot2.x搭建springcloudspringboot2.x搭建springcloudspringboot2.x搭建springcloudspringboot2.x搭建springcloudspringboot2.x搭建springcloud

3、创建zuul网关.代码如下所示。使用网关的端口访问刚才创建的服务。地址为网关端口/服务名(小写)/controller/定义的方法名

springboot2.x搭建springcloudspringboot2.x搭建springcloudspringboot2.x搭建springcloud
© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com