Implemented URL query parsing for initial token /opa/?token=abcde
[src/app-framework-demo.git] / afb-client / app / Frontend / etc / ConfigApp.js
1 (function () {
2     'use strict';
3
4     // _all modules only reference dependencies
5     angular.module('ConfigApp', [])
6
7             // Factory is a singleton and share its context within all instances.
8             .factory('ConfigApp', function (urlquery) {
9
10                 var myConfig = {
11                     paths: { // Warning paths should end with /
12                         image : 'images/',
13                         avatar: 'images/avatars/',
14                         audio : 'images/audio/',
15                         appli : 'images/appli/'
16                     },
17                     
18                     myapi: { // Warning paths should end with /
19                        token : '/api/myplugin/xxxx'
20                     },
21                     
22                     session: { // Those data are updated by session service
23                        create  : '/api/token/create',
24                        refresh : '/api/token/refresh',
25                        check   : '/api/token/check',
26                        reset   : '/api/token/reset',
27                        ping    : '/api/token/check',
28                        initial : urlquery.token || '123456789',  // typical dev initial token
29                        timeout : 3600,         // timeout is updated client sessin context creation
30                        pingrate: 60,           // Ping rate to check if server is still alive
31                        uuid    : '',           // uuid map with cookie or long term session access key
32                        token   : ''            // will be returned from authentication    
33                     }
34                 };
35
36                 return myConfig;
37             });
38
39 })();