Skip to content
@drupflare/spool v1.0.0 GitHub
    Preparing search index...

    Type Alias DataRoute

    DataRoute: RouteCommon & QueryRoute & FamilyRoute & {
        contentType?: string;
        origin?: string;
        strategy: "data";
    }

    A route for a JSON read. The worker answers a GET (not a navigation) from the stored value with JSON.stringify, so the application's own handler has to return the same JSON load does. With family the answer is the held row; with origin the GET may come from that other origin, and query.dataset without a family makes the collection of the dataset.

    Type Declaration

    • OptionalcontentType?: string

      the content type of the local answer; default application/json

    • Optionalorigin?: string

      the API origin a cross-origin family answers for; absent for the page's own origin. A public route answers from the public replica. A principal route (scope or auth) answers only a GET with an Authorization header, only from the signed-in partition, and stops when the partition is wiped; every other request goes to the API.

    • strategy: "data"

      answers a GET with the stored JSON