Syncing with Files on Server

27 views
Skip to first unread message

Giordon Stark

unread,
Mar 17, 2016, 2:40:44 AM3/17/16
to Firepad
Hi all,

I've gotten Firepad set up for collaborative editing (using Ace) where the defaultText will be a file that exists on my server. EG: I have routes like the following

/edit/:fileName

which will grab the appropriate file's text and set the defaultText. This works fine and Firepads are built for a bunch of files with the right default text. Now the question is, how do I hook it in a way to resync the file that exists on the server? That way, the contents of the file on server is constantly synced with the text users are seeing that come from Firebase/Firepad. It would be great to have all the functionality of Firepad + Ace -- but if this is not possible at all, I might roll my own solution like http://www.laktek.com/2010/05/25/real-time-collaborative-editing-with-websockets-node-js-redis/

Thanks

Giordon

Giordon Stark

unread,
Mar 17, 2016, 2:50:15 AM3/17/16
to Firepad
Note -- an idea I had was to provide a "save" button that would simply grab the current text via `getText()` and post it to the server which would then save it. Presumably, I could also bind the CMD+S / CTRL+S commands to also do these saves as well. Not sure if this is good or bad, but it is a possibility.
Reply all
Reply to author
Forward
0 new messages