pyRPC
DemoBlogChangelogDocs
Server

Standalone ASGI Adapter

Use the minimal PyRPCAsgiApp directly as your ASGI app.

Standalone ASGI Adapter

For minimal deployments or ASGI-first frameworks, use the built-in PyRPCAsgiApp.

Basic Usage

from pyrpc_core import PyRPCAsgiApp

app = PyRPCAsgiApp()

Or use the pre-created instance:

from pyrpc_core import asgi_app

This ASGI app:

  • handles only POST /rpc
  • reads the JSON body
  • calls handle_request(payload)
  • returns a JSON-RPC response

Mounting Under a Prefix

Use your ASGI framework/router to mount the app at a prefix (e.g. /api/rpc). The app itself listens on /rpc internally; the outer router controls the external path.