hosts property

List<String> hosts
getter/setter pair

The primary hostname constraints for this route.

Specifies which hostnames this route should respond to. Useful for multi-tenant applications or domain-specific routing.

  • ['*'] (default): Matches all hostnames
  • ['example.com']: Matches only requests to example.com
  • ['api.example.com', 'admin.example.com']: Matches specific subdomains

Implementation

late List<String> hosts;