sveltekit-service-manager - v1.1.0
    Preparing search index...

    Class ServiceRouter

    A minimal, fast router for service-relative routing.

    Optimizations:

    • Routes are indexed per method (avoids scanning non-matching methods)
    • Routes and nested routers are sorted once on mutation (not per request)
    • Param extraction uses stored match + metadata (no extra regex compile per match)
    Index

    Constructors

    Accessors

    • get nestedRouters(): readonly NestedRouter[]

      Returns readonly NestedRouter[]

      Dangerous read-only access. Do not mutate. Nested routers are used for prefix dispatch.

    • get routes(): readonly Route<any>[]

      Returns readonly Route<any>[]

      Dangerous read-only access. Do not mutate. The router relies on these objects for matching requests.

    Methods

    • Remove routes or nested routers.

      • If method is omitted: removes the nested router with this prefix AND all routes with this exact path.
      • If method is provided: removes only the route with this exact path+method.

      Parameters

      Returns this

    POST

    • Remove all registered routes and nested routers. Useful for HMR to prevent stale route handlers from remaining registered.

      Returns this