Managing environment using babel
diff --git a/mCordPortal/src/app/services/config.js b/mCordPortal/src/app/services/config.js
new file mode 100644
index 0000000..9bba19f
--- /dev/null
+++ b/mCordPortal/src/app/services/config.js
@@ -0,0 +1,10 @@
+(function () {
+ angular.module('mCord')
+ .value('baseUrl', (function(){
+ if (process.env.MOCK === 'true') {
+ return 'http://private-c85424-progranrestapi.apiary-mock.com/';
+ } else {
+ return '';
+ }
+ })())
+})();
\ No newline at end of file
diff --git a/mCordPortal/src/app/services/rest/enodeb.js b/mCordPortal/src/app/services/rest/enodeb.js
index bf6415c..42cd062 100644
--- a/mCordPortal/src/app/services/rest/enodeb.js
+++ b/mCordPortal/src/app/services/rest/enodeb.js
@@ -1,6 +1,6 @@
(function () {
angular.module('mCord')
- .service('Enodeb', function($resource){
- return $resource('http://private-c85424-progranrestapi.apiary-mock.com/api/enodeb/:id', {id: '@id'});
+ .service('Enodeb', function($resource, baseUrl){
+ return $resource(`${baseUrl}api/enodeb/:id`, {id: '@id'});
})
})();
\ No newline at end of file