Добавление документации

This commit is contained in:
2022-02-18 23:48:24 +03:00
parent 425ae46085
commit 18cd6c8d16
7 changed files with 181 additions and 0 deletions

24
docs/source/usage.rst Normal file
View File

@@ -0,0 +1,24 @@
Использование
=============
.. code-block:: python
from jsonrpc import JSONRPC
jsonrpc = JSONRPC()
@jsonrpc.method('app.endpoint')
def app_endpoint(a: int, b: int) -> int:
result = a + b
return result
request = {
"jsonrpc": "2.0",
"method": "app.endpoint",
"params": {"a": 1, "b": 2},
"id": "1"
}
response = jsonrpc(request)
print(response)