diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-01-22 17:53:15 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-01-22 17:53:15 +0100 |
commit | 9435bfc2174ee35ea36c2ada14dc2a8275e56331 (patch) | |
tree | b4d3058af71f5d1e10c60229f5c1fcecea6a7d02 /js/app/Config.js | |
parent | dc9392d0f8881ab7736f0daf1f785e5c3d0871ef (diff) |
change explore url
Diffstat (limited to 'js/app/Config.js')
-rw-r--r-- | js/app/Config.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/js/app/Config.js b/js/app/Config.js index dda2e1939..e7488bbd7 100644 --- a/js/app/Config.js +++ b/js/app/Config.js @@ -143,15 +143,18 @@ app.config(function ($routeProvider, $provide, $httpProvider) { $http.get(BASE_URL + '/settings').then(function (data) { Publisher.publishAll(data); - var url = SettingsResource.get('exploreUrl'); + // get url and strip trailing slashes + var url = SettingsResource.get('exploreUrl') + .replace(/\/+$/, ''); var language = SettingsResource.get('language'); - return $http({ - url: url, - method: 'GET', - params: { - lang: language - } - }); + + var exploreUrl = url + '/sites.' + language + '.json'; + var defaultExploreUrl = url + '/sites.en.json'; + return $http + .get(exploreUrl) + .catch(function () { + return $http.get(defaultExploreUrl); + }); }).then(function (data) { deferred.resolve(data.data); |