<commit_before>//
//This is the client code to connect to FDrest
//

define([
    'dojo/_base/declare',
    'dojo'
], function(declare,dojo){
	return declare(null, {
	    baseURL: 'http://localhost:3007',
	    isAvailable: function() {
	        // Using dojo.xhrGet, as very little information is being sent
            dojo.xhrGet({
                // The URL of the request
                url: this.baseURL + '/monitoring/isAlive',
                // The success callback with result from server
                load: function(newContent) {
                    this.log('monitoring/isAlive -> ' + newContent);
                },
                // The error handler
                error: function() {
                    // Do nothing -- keep old content there
                }
            });
	    },
	    log: function(msg) {
            console.log( msg );
        }
	
	});
});<commit_msg>improving request code to use recent dojo/request to do cross domain properly.<commit_after>//
//This is the client code to connect to FDrest
//

define([
    'dojo/_base/declare',
    'dojo/request'
], function(declare,request){
	return declare(null, {
	    baseURL: 'http://localhost:3007',
	    
	    log: function(msg) {
            console.log( msg );
        },
	    isAvailable: function() {
	        var self=this;
	        request(this.baseURL + '/rest/monitoring/isAlive', {
                headers: {
                     'X-Requested-With': null
                }
                //, withCredentials: true
            }).then(function(data){
                // do something with handled data
                self.log('/rest/monitoring/isAlive -> ' + data);
            }, function(err){
                // handle an error condition
                self.log('/rest/monitoring/isAlive -> ' + err);
            }, function(evt){
                // handle a progress event
                self.log('/rest/monitoring/isAlive -> ' + evt);
            });

	    }	
	});
});
{'fraction_non_alphanumeric': 0.12658227848101267, 'fraction_numerical': 0.004050632911392405, 'mean_word_length': 1.4607721046077211, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4794658', 'n_tokens_mistral': 565, 'n_tokens_neox': 521, 'n_words': 130}