-
Notifications
You must be signed in to change notification settings - Fork 40
Werkzeug
Beau Barker edited this page Jul 3, 2025
·
4 revisions
"""Werkzeug server""" from werkzeug.serving import run_simple from werkzeug.wrappers import Request, Response
from jsonrpcserver import Result, Success, dispatch, method
@method def ping() -> Result: """JSON-RPC method""" return Success("pong")
@Request.application def application(request: Request) -> Response: """Handle Werkzeug request""" return Response(dispatch(request.data.decode()), 200, mimetype="application/json")
if name == "main": run_simple("localhost", 5000, application)
Contributions are appreciated – simply hit Edit or New page.