Skip to content

Instantly share code, notes, and snippets.

@tos-kamiya
Created September 22, 2024 06:36
Show Gist options
  • Save tos-kamiya/745bebe8311da9cb4a0b697746b9f9e7 to your computer and use it in GitHub Desktop.
Save tos-kamiya/745bebe8311da9cb4a0b697746b9f9e7 to your computer and use it in GitHub Desktop.
json-rpc with flask backend test
"""
python3 -m venv venv; venv/bin/pip install wheel
venv/bin/pip install json-rpc
venv/bin/pip install flask
"""
from flask import Flask
from jsonrpc.backend.flask import api
app = Flask(__name__)
app.register_blueprint(api.as_blueprint())
@api.dispatcher.add_method
def echo(*args, **kwargs):
return args
if __name__ == ('__main__'):
app.run(debug=True, host='0.0.0.0', port=4000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment