# by-cloud **Repository Path**: survive2/by-cloud ## Basic Information - **Project Name**: by-cloud - **Description**: 分布式项目搭建 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-11-06 - **Last Updated**: 2025-02-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## dev # 1.网关gateway ## 添加依赖 ```xml org.springframework.cloud spring-cloud-starter-gateway ``` 动态路由访问地址: localhost:80/服务名(by-system)/接口地址 ## 开启动态路由:通过动态路由,直接开启了负载均衡功能 ```xml org.springframework.cloud spring-cloud-starter-loadbalancer com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery ``` ```yaml server: port: 80 spring: application: name: sc-gateway cloud: gateway: discovery: locator: enabled: true #开启动态路由 默认使用微服务的应用名 nacos: discovery: server-addr: 127.0.0.1:8848 username: nacos password: nacos ```