@whi/cf-routing - v0.2.0
    Preparing search index...

    Function handleDurableObjectRoute

    • Wrapper function to handle JSON responses and errors for Durable Object route handlers

      Supports three return patterns:

      1. Return a Response object directly for full control
      2. Modify this.response (ResponseContext) and return data for the body
      3. Return plain data (current behavior - JSON serialized with defaults)

      Parameters

      • handler: (request: Request, params?: Record<string, string>) => Promise<any>

        The route handler function

      • OptionalresponseContext: ResponseContext

        Optional ResponseContext for customizing response properties

      Returns (request: Request) => Promise<Response>

      A wrapped handler function that handles JSON responses and errors