Created
September 22, 2024 06:36
-
-
Save tos-kamiya/745bebe8311da9cb4a0b697746b9f9e7 to your computer and use it in GitHub Desktop.
json-rpc with flask backend test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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