arnaucube
arnaucube/blockchainIDsystemPublic Self-hosted repository
blockchainIDsystem/serverCA/webapp/app.js
serverCA/webapp/app.jsRaw
 1'use strict';
 2
 3var urlapi = "http://localhost:3030/";
 4
 5// Declare app level module which depends on views, and components
 6angular.module('webapp', [
 7  'ngRoute',
 8  'ngMessages',
 9  'angularBootstrapMaterial',
10  'toastr',
11  'app.navbar',
12  'app.main'
13]).
14config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) {
15  $locationProvider.hashPrefix('!');
16
17  $routeProvider.otherwise({redirectTo: '/main'});
18}])
19.config(function(toastrConfig) {
20  angular.extend(toastrConfig, {
21    autoDismiss: false,
22    containerId: 'toast-container',
23    maxOpened: 0,
24    newestOnTop: true,
25    positionClass: 'toast-bottom-right',
26    preventDuplicates: false,
27    preventOpenDuplicates: false,
28    target: 'body'
29  });
30})
31.factory('httpInterceptor', function httpInterceptor () {
32  return {
33    request: function(config) {
34      return config;
35    },
36
37    requestError: function(config) {
38      return config;
39    },
40
41    response: function(res) {
42      return res;
43    },
44
45    responseError: function(res) {
46      return res;
47    }
48  };
49})
50.factory('api', function ($http) {
51	return {
52		init: function () {
53      /*$http.defaults.headers.common['X-Access-Token'] = localStorage.getItem('cr_webapp_token');
54      $http.defaults.headers.post['X-Access-Token'] = localStorage.getItem('cr_webapp_token');*/
55		}
56	};
57})
58.run(function (api) {
59	api.init();
60});