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

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

BotleaguesApi.request = function(user_options) {
    var options = {
        endpoint: null,
        method: 'GET',
        dataType: 'jsonp'
    };
    for (var name in user_options) {
        options[name] = user_options[name];
    }

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

    jQuery.ajax(url, options);
}