Integration of ServerSide Javascript with Python

117 views Asked by At

I am building a web app which uses a JSON array to save and transfer state between server and client and vice versa. I'm attempting to add 'collaboration' capabilities to it such it that multiple clients can simultaneously edit the json data without causing conflicts and with the data being updated on all clients in real time.

On the backend I'm using python so I was very happy to find the opencoweb project, sadly it is no longer being maintained. Similarly, I've found ShareDB and it seems like a very neat project! I would like to spin up ShareDB on my server side from my Python code but am unsure as to what the best approach to running javascript code server side would be. At this point, I'm considering just running it with node from the command line, but wondering whether it would make more sense to use a python library which can allow the running of javascript (Js2Py or something similar). So this brings me to my question, on the server side is there a 'recommended' approach to integrating javascript into your server side code base when using python (tornado) for your main framework?

1

There are 1 answers

0
Flaminator On BEST ANSWER

I believe I've come up with an answer to my own question. It seems like this question has been discussed here prior, where the recommendation was to use sockets, and the recommendation of using zerorpc got alot of up-votes. So in my case, I would likely be running the ShareDB as a service which I would be calling from Python using zerorpc. Hopefully this helps someone else in my shoes!