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

Function startServer

examples/counter-json1/server.js:26–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected