Overview

This section provides the general overview of the integration.

Installation

$ pip install bthlabs_jsonrpc_aiohttp

Usage

First, you’ll need to add a JSONRPC view to your project’s URLs:

# app.py
app = web.Application()

app.add_routes([
    web.post('/rpc', JSONRPCView()),
])

Then, you’ll need to implement the RPC method modules:

# your_app/rpc_methods.py
from bthlabs_jsonrpc_core import register_method

@register_method(name='hello')
async def hello(request, who='World'):
    return f'Hello, {who}!'