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

    Function sortRoutes

    • Sort routes by priority and specificity Routes with lower priority numbers are placed first Within same priority, more specific routes come first

      Parameters

      Returns CaddyRoute[]

      Sorted routes (does not mutate input)

      const routes = [
      { match: [{ path: ["/*"] }] }, // Wildcard
      { match: [{ path: ["/health"] }] }, // Health
      { match: [{ path: ["/api/*"] }] }, // API
      ];
      const sorted = sortRoutes(routes);
      // Order: health, api, wildcard