Stone.js API
    Preparing search index...

    Class RouteCollection<IncomingEventType, OutgoingResponseType>

    Manages a collection of Route instances.

    Type Parameters

    • IncomingEventType extends IIncomingEvent = IIncomingEvent

      The type of incoming HTTP events.

    • OutgoingResponseType = unknown

      The type of outgoing HTTP responses.

    Index
    • get size(): number

      Retrieves the total number of routes in the collection.

      Returns number

    • Dumps all routes as an array of JSON objects.

      Returns Promise<Record<string, unknown>[]>

      An array of route definitions.

    • Checks if a named route exists.

      Parameters

      • name: string

        The name of the route.

      Returns boolean

      true if the named route exists, false otherwise.

    • Converts all routes to a JSON string.

      Returns Promise<string>

      A JSON string representing all routes.