Traté de codificar con documentos FastAPI, pero no hay forma de acceder a js y devolución de llamada de python
¿Es posible usar la devolución de llamada de python en js y acceder a javascript en FastAPI?
from flask import Flask from flask import render_template import jyserver.Flask as jsf app = Flask(__name__) @jsf.use(app) class App: def __init__(self): self.count = 0 def increment(self): self.count += 1 self.js.document.getElementById('count').innerHTML = self.count @app.route('/') def index(): return App.render(render_template('index.html')) if __name__ == '__main__': app.run() <!DOCTYPE html> <html> <head> <title>Change DOM</title> </head> <body> <p id="count">0</p> <button onclick="server.increment()">Increment</button> </body> </html> Quiero usar FastAPI así...
(Ejemplos jyserver)
referencia1: https://github.com/sohan-py/ChangeDOM
referencia 2: https://dev.to/ftrias/access-js-dom-from-flask-app-using-jyserver-23h9
Intenté usar el método asíncrono y POST, GET, pero no puedo encontrar soluciones.