# gateway-service/src/main/resources/application.yml
server:
  port: 8080
spring:
  application:
    name: gateway-service
  cloud:
    gateway:
      routes:
        - id: products
          uri: lb://product-service
          predicates:
            - Path=/api/products/**
        - id: orders
          uri: lb://order-service
          predicates:
            - Path=/api/orders/**
        - id: auth
          uri: lb://auth-service
          predicates:
            - Path=/api/auth/**
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka

lb:// resolves the service name through Eureka and load-balances across instances. With Spring Cloud 2025.0 or later, the same routes live under spring.cloud.gateway.server.webflux.routes. The step-by-step setup is in the guide on service discovery and an API gateway with Spring Cloud.