{"size": 896, "ext": "js", "max_stars_repo_path": "modules/test_player_coord_server.js", "max_stars_repo_name": "weepingwillowben/web-script-wars", "max_stars_repo_stars_event_min_datetime": "2020-09-19T00:57:33.000Z", "max_stars_repo_stars_event_max_datetime": "2020-09-19T00:57:33.000Z", "max_issues_repo_path": "modules/test_player_coord_server.js", "max_issues_repo_name": "weepingwillowben/web-script-wars", "max_issues_repo_issues_event_min_datetime": "2021-05-29T00:52:22.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-01T23:13:44.000Z", "max_forks_repo_path": "modules/test_player_coord_server.js", "max_forks_repo_name": "weepingwillowben/large-battles-web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 23.5789473684, "max_line_length": 65, "alphanum_fraction": 0.4464285714}

var request = require('request')


function log_game_result(){
    var req_options = {
        uri: 'http://localhost:8804/log_game_result',
        method: 'POST',
        json: {
            "game_id": "EXAMPLE_GAME_ID",
            "results": [
                {
                    username: "user1",
                    winrecord: "victory",
                },
                {
                    username: "user2",
                    winrecord: "defeat",
                }
            ],
        }
    };

    request(req_options, function (error, response, body) {
        if(error){
            console.log(error)
        }
        else if (response.statusCode != 200) {
            console.log("log reqeust status"+response.statusCode)
            console.log(body)
        }
        else{
            console.log("successfully logged results")
        }
    });
}
log_game_result()
