{"size": 400, "ext": "js", "max_stars_repo_path": "test-server/server.js", "max_stars_repo_name": "Paul2708/cercet", "max_stars_repo_stars_event_min_datetime": "2020-11-24T14:17:11.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-30T12:48:33.000Z", "max_issues_repo_path": "test-server/server.js", "max_issues_repo_name": "Paul2708/cercet", "max_issues_repo_issues_event_min_datetime": "2020-11-18T20:53:52.000Z", "max_issues_repo_issues_event_max_datetime": "2020-12-28T16:11:31.000Z", "max_forks_repo_path": "test-server/server.js", "max_forks_repo_name": "Paul2708/cercet", "max_forks_repo_forks_event_min_datetime": "2020-11-16T16:48:49.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-18T19:32:05.000Z"}
{"max_stars_count": 4, "max_issues_count": 21, "max_forks_count": 4, "avg_line_length": 25.0, "max_line_length": 74, "alphanum_fraction": 0.5875}
const WebSocket = require('ws');

const patches = require('./patches.json');

const wss = new WebSocket.Server({port: 8080});
wss.on('connection', ws => {
    ws.on('message', message => {
        console.log('received: %s', message);
    });

    setTimeout(() => {
        const patch = patches[Math.floor(Math.random() * patches.length)];
        ws.send(JSON.stringify(patch));
    }, 5000);
});
