# Traefik Dynamic Configuration
http:
  routers:
    # API Router - highest priority for /api paths
    api:
      rule: 'PathPrefix(`/api/`)'
      entryPoints:
        - web
      service: api
      priority: 100

    # WebSocket Router - highest priority for socket.io
    websocket:
      rule: 'PathPrefix(`/socket.io`)'
      entryPoints:
        - web
      service: api
      priority: 100

    # Dashboard Router - catch-all for frontend (lowest priority)
    dashboard:
      rule: 'PathPrefix(`/`)'
      entryPoints:
        - web
      service: dashboard
      priority: 1

  services:
    api:
      loadBalancer:
        servers:
          - url: 'http://openwa-api:2785'

    dashboard:
      loadBalancer:
        servers:
          - url: 'http://openwa-dashboard:80'
