<commit_before>/*jshint newcap: false */

angular.module( 'apicatus', [
    'templates-app',
    'templates-common',
    'apicatus.main',
    'apicatus.home',
    'apicatus.login',
    'apicatus.logout',
    'apicatus.applications',
    'apicatus.application',
    'apicatus.dashboard',
    'apicatus.settings',
    'apicatus.error',
    'apicatus.help',
    'AuthService',
    'timeago',
    'humanize',
    'restangular',
    'ui.bootstrap',
    'ui.router',
    'ui.utils',
    'LocalStorageModule',
    'ngCookies',
    'pascalprecht.translate',
    'ui.ace',
    'parseURL',
    'httpSettings',
    'ngSocket'
])
// Global constans
.constant('$moment', moment)
.config( function myAppConfig ( $stateProvider, $urlRouterProvider, $locationProvider, $translateProvider, $documentProvider, RestangularProvider, localStorageServiceProvider ) {
    $urlRouterProvider.otherwise( '/main/applications/list' );
    //$locationProvider.html5Mode(true);
    RestangularProvider.setBaseUrl(document.location.origin);
    RestangularProvider.setRestangularFields({
        id: "_id"
    });
    RestangularProvider.setDefaultHeaders({
        "Content-Type": "application/json",
        "X-Requested-With": "XMLHttpRequest",
        "Access-Control-Allow-Headers": "x-requested-with"
    });
    $translateProvider.useStaticFilesLoader({
        prefix: '/languages/',
        suffix: '.json'
    });
    $translateProvider.preferredLanguage('en');
    //RestangularProvider.setDefaultHttpFields({cache: true});
    localStorageServiceProvider.setPrefix('apicatus');
})

.run(function run($rootScope, $state, AuthService, Restangular) {
    Restangular.setErrorInterceptor(function (response) {
        console.log("error: ", response);
        switch(response.status) {
            case 401:
                $state.transitionTo("main.login");
                break;
            case 403:
                $state.transitionTo("main.login");
                break;
            case 404:
                //$state.transitionTo("main.error.404", {data: "response.data"});
                break;
            case 500:<commit_msg>fix CORS stuff<commit_after>/*jshint newcap: false */

angular.module( 'apicatus', [
    'templates-app',
    'templates-common',
    'apicatus.main',
    'apicatus.home',
    'apicatus.login',
    'apicatus.logout',
    'apicatus.applications',
    'apicatus.application',
    'apicatus.dashboard',
    'apicatus.settings',
    'apicatus.error',
    'apicatus.help',
    'AuthService',
    'timeago',
    'humanize',
    'restangular',
    'ui.bootstrap',
    'ui.router',
    'ui.utils',
    'LocalStorageModule',
    'ngCookies',
    'pascalprecht.translate',
    'ui.ace',
    'parseURL',
    'httpSettings',
    'ngSocket'
])
// Global constans
.constant('$moment', moment)
.config( function myAppConfig ( $stateProvider, $urlRouterProvider, $locationProvider, $translateProvider, $documentProvider, RestangularProvider, localStorageServiceProvider ) {
    $urlRouterProvider.otherwise( '/main/applications/list' );
    //$locationProvider.html5Mode(true);
    RestangularProvider.setBaseUrl(document.location.protocol + '//api.' + document.location.host);
    RestangularProvider.setRestangularFields({
        id: "_id"
    });
    RestangularProvider.setDefaultHeaders({
        "Content-Type": "application/json"
    });
    $translateProvider.useStaticFilesLoader({
        prefix: '/languages/',
        suffix: '.json'
    });
    $translateProvider.preferredLanguage('en');
    //RestangularProvider.setDefaultHttpFields({cache: true});
    localStorageServiceProvider.setPrefix('apicatus');
})

.run(function run($rootScope, $state, AuthService, Restangular) {
    Restangular.setErrorInterceptor(function (response) {
        console.log("error: ", response);
        switch(response.status) {
            case 401:
                $state.transitionTo("main.login");
                break;
            case 403:
                $state.transitionTo("main.login");
                break;
            case 404:
                //$state.transitionTo("main.error.404", {data: "response.data"});
                break;
            case 500:
{'fraction_non_alphanumeric': 0.1454981992797119, 'fraction_numerical': 0.007683073229291717, 'mean_word_length': 2.8898225957049486, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, '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': '3896476', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1228, 'n_words': 187}