sharejs.codemirror.example
v0.0.1
Published
Includes an example JS websocket sharejs server, and a client page that uses codemirror with sharejs.
Downloads
8
Readme
sharejs.codemirror.example
This repo was created so I would have a working share.js / codemirror example with the following traits:
- Use Share.js 7.x
- Use CodeMirror for the text editor
- Use WebSockets instead of browserchannel for client / server communication. I like browserchannel, but I'm using share in a project that already has a huge number of dependencies.
- Use JavaScript instead of CoffeeScript. I don't know CoffeeScript, although I like the way it looks...
##Installation and Use##
###Server###
Using Git:
- After cloning the repo, run
npm install
in its top level - To launch the server, run
node .
in the top level. You can optionally pass a port to run on with the-p
argument
Using NPM:
- Create a directory for the project and
cd
into it - Run
npm install share.js.codemirror.example
to install - Run
node node_modules/share.js.codemirror.example
to start the server. You can optionally pass a port to run on with the-p
argument
###Client###
- Open a browser and launch
127.0.0.1:8007
substituting a port number you passed as an argument when starting the server if needed. - Open another tab and launch the same url
- Type some JavaScript into the codemirror instances. They should be synced.