4 // _all modules only reference dependencies
5 angular.module('AppConfig', [])
7 // Factory is a singleton and share its context within all instances.
8 .factory('AppConfig', function () {
10 // console.log ("URL="+ $location.url() + " Query=" + location.href+ " window=" + document.referrer);
14 paths: { // Warning paths should end with /
16 icons : 'images/icons/',
17 avatar: 'images/avatars/',
18 audio : 'images/audio/'
21 myapi: { // Warning paths should end with /
22 token : '/api/myplugin/xxxx'
25 session: { // Those data are updated by session service
26 create : '/api/token/create',
27 refresh : '/api/token/refresh',
28 check : '/api/token/check',
29 reset : '/api/token/reset',
30 ping : '/api/token/check',
31 initial : '123456789', // typical dev initial token
32 timeout : 3600, // timeout is updated client sessin context creation
33 pingrate: 60, // Ping rate to check if server is still alive
34 uuid : '', // uuid map with cookie or long term session access key
35 token : '' // will be returned from authentication
42 // Factory is a singleton and share its context within all instances.
43 .factory('AppCall', function ($http, AppConfig) {
45 get : function(plugin, action, query, callback) {
46 query["token"] = AppConfig.session.token; // add token to provided query
47 $http.get('/api/' + plugin + '/' + action , {params: query}).then (callback, callback);