<commit_before>class ApplicationConfiguration {
    constructor() {
        this.configuratiun = require('/config.json');
        console.log(this.configuratiun);
    }

    get ApiEndpoint() {
        return this.configuratiun.ApiEndpoint;
    }

    get OldUIAddress() {
        return this.configuratiun.OldUIAddress;
    }

    get LoginPageAddress() {
        return this.configuratiun.LoginPageAddress;
    }
}

export default new ApplicationConfiguration();<commit_msg>Update configuration loading<commit_after>class ApplicationConfiguration {
    constructor() {
        //this.configuratiun = require('./config.json');

        const json = this.loadTextFileAjaxSync('/config.json');
        this.configuratiun = JSON.parse(json);

        console.log(this.configuratiun);
    }

    get ApiEndpoint() {
        return this.configuratiun.ApiEndpoint;
    }

    get OldUIAddress() {
        return this.configuratiun.OldUIAddress;
    }

    get LoginPageAddress() {
        return this.configuratiun.LoginPageAddress;
    }

    loadTextFileAjaxSync(filePath)
    {
        const xmlhttp = new XMLHttpRequest();
        xmlhttp.open("GET",filePath,false);

        xmlhttp.send();

        if (xmlhttp.status==200 && xmlhttp.readyState == 4 )
        {
            return xmlhttp.responseText;
        }
        else {
            // TODO Throw exception
            return null;
        }
    }
}


export default new ApplicationConfiguration();
{'fraction_non_alphanumeric': 0.10370879120879122, 'fraction_numerical': 0.0027472527472527475, 'mean_word_length': 2.4121779859484778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '2952797', 'n_tokens_mistral': 416, 'n_tokens_neox': 402, 'n_words': 69}