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

    Function defineResource

    • Declares a resource. GET <pattern> is the collection of the dataset, with no query string; a query string is not answered locally. GET <pattern>/:key is a data family of the dataset; POST <pattern> inserts; PUT and PATCH <pattern>/:key replace and update; DELETE <pattern>/:key removes. Any POST, PUT, PATCH or DELETE of <pattern>/:key/:action is a write on that item. Every write updates the collection and the item.

      Parameters

      • pattern: string
      • declaration: { dataset: string; key: string; origin?: string }

      Returns Resource