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

Function startServer

examples/textarea/server.js:24–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22}
23
24function startServer() {
25 // Create a web server to serve files and listen to WebSocket connections
26 var app = express();
27 app.use(express.static('static'));
28 var server = http.createServer(app);
29
30 // Connect any incoming WebSocket connection to ShareDB
31 var wss = new WebSocket.Server({server: server});
32 wss.on('connection', function(ws) {
33 var stream = new WebSocketJSONStream(ws);
34 backend.listen(stream);
35 });
36
37 server.listen(8080);
38 console.log('Listening on http://localhost:8080');
39}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected