@accelerated-software-development/caddy-api-client - v0.7.1
    Preparing search index...

    Function collectExternalHostsFromRoutes

    • Walk a Caddy routes[] tree (or any nested fragment) and collect every non-internal hostname referenced in match[].host[].

      Recurses into Caddy's subroute handler shape, where nested routes live at handle[].routes[]. Hostnames Caddy already treats as internal (localhost, *.localhost, .localhost suffixes, literal IPs) are filtered out — see isInternalHost.

      Useful as input to buildAutomaticHttpsConfig when you want automatic_https.skip to mirror the actual route topology rather than a fixed list maintained somewhere else.

      Parameters

      • routes: unknown

        A Caddy server.routes array (or any nested fragment).

      Returns string[]

      Sorted, de-duplicated list of non-internal hostnames.