Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/substance/hub
Experimental server for realtime collab
https://github.com/substance/hub
Last synced: about 2 months ago
JSON representation
Experimental server for realtime collab
- Host: GitHub
- URL: https://github.com/substance/hub
- Owner: substance
- Created: 2015-12-19T13:53:46.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-11T16:32:10.000Z (almost 9 years ago)
- Last Synced: 2024-04-15T12:47:31.571Z (9 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hub
Experimental server for realtime collab.
On server:
run ```npm run seed``` and then ```npm run start```
On client:
```js
var host = "ws://localhost:8080";
var ws = new WebSocket(host);ws.onmessage = function (event) {
var msg = JSON.parse(event.data);
console.log(msg);
}ws.send('{"type":"add","set":"doc-15/master","data":{"a":"b","b":"c"}}');
```will print `{status: 'ok'}`.
```js
ws.send('{"type":"get","set":"doc-15/master"}');
```will print array of objects `{id:'doc-15/master', data: {...}}`.