/* globals angular */
'use strict';

import environment from "angular-environment";

angular.module('EnterpriseDashboardApp.HostFactory', [
		'EnterpriseDashboardApp.Authentication',
        environment
]).service('HostFactory', function HostFactory($log, envService, Authentication) {
    return {
        getScheme: function() {
            // return 'https';
            $log.info('SCHEME is', envService.read('SCHEME'));
            return envService.read('SCHEME');
        },
        getHost: function() {
            var HOST;

            HOST = envService.read('HOST');

            $log.info('HOST is ', HOST);
            return HOST;
            // return HOST;
        },
        getWebSocketUrl: function() {
            var url;

            url = 'ws://' + envService.read('WS_HOST');
            url = url + '/?token=' + Authentication.getAuthenticationToken();

            $log.info('WS URL', url);

            return url;
        },
        getDbUrlComponent: function() {
            var DB_URL_COMPONENT;

            DB_URL_COMPONENT = envService.read('DB_URL_COMPONENT');


            $log.info('DB_URL_COMPONENT is ', DB_URL_COMPONENT);
            return DB_URL_COMPONENT;
        },
        getDataExportServerHost: function() {
            var HOST;

            HOST = envService.read('HOST');

            $log.info('DATA EXPORT SERVER is ', HOST);
            return HOST;
        }
    };
});
