aboutsummaryrefslogtreecommitdiff
path: root/src/js/Botleagues.js
blob: fd8ed21737cac9a67863e42dfcdfaefce3a8e7bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function Botleagues(){}

Botleagues.url = 'https://api.local.botleagues.camilstaps.nl';

Botleagues.request = function(user_options, callback) {
    var options = {
        endpoint: null,
        method: 'GET',
        dataType: 'json',
        done: function(data) {
            callback(data);
        }
    };
    for (var name in user_options) {
        options[name] = user_options[name];
    }

    var url = Botleagues.url + '/' + options['endpoint'];
    delete options['endpoint'];

    jQuery.ajax(url, options);
};