MCPcopy Create free account
hub / github.com/FernhillFable/cluster / createDoc

Function createDoc

examples/rich-text/server.js:13–24  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

11
12// Create initial document then fire callback
13function createDoc(callback) {
14 var connection = backend.connect();
15 var doc = connection.get('examples', 'richtext');
16 doc.fetch(function(err) {
17 if (err) throw err;
18 if (doc.type === null) {
19 doc.create([{insert: 'Hi!'}], 'rich-text', callback);
20 return;
21 }
22 callback();
23 });
24}
25
26function startServer() {
27 // Create a web server to serve files and listen to WebSocket connections

Callers 1

server.jsFile · 0.70

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected