effect-rpc
    Preparing search index...

    Function makeRPCBackendLayer

    • Creates an RPC backend layer using HTTP protocol.

      This function constructs a layered RPC client configured to communicate with a remote endpoint over HTTP. It uses the Fetch API for HTTP requests and NDJSON for request/response serialization.

      Parameters

      • config: { endpoint?: string; url: string }

        Configuration object for the RPC backend.

        • Optionalendpoint?: string

          (Optional) The specific endpoint path to append to the base URL.

        • url: string

          The base URL of the RPC server.

      Returns Layer<Protocol, never, never>

      A Layer instance that provides the configured RPC client.

      • The returned layer is composed with:
        • FetchHttpClient.layer for HTTP transport using the Fetch API.
        • RpcSerialization.layerNdjson for NDJSON serialization.
      • The endpoint is appended to the base URL if provided.
      const backend = makeRPCBackendLayer({ url: "https://api.example.com", endpoint: "/rpc" });
      

      Use createEffectRPC instead. It does the same thing, but with a more descriptive name.