dataproxy/Community.js: abstract the prefixing of the communities payload URL

This commit is contained in:
Peter Williams 2020-03-28 11:49:52 -04:00
Родитель bda9ee5cb1
Коммит 37684e7036
4 изменённых файлов: 9 добавлений и 1 удалений

1
app.js
Просмотреть файл

@ -31,6 +31,7 @@
var wwt = {
gitShortSha: '<%= gitinfo.local.branch.current.shortSHA %>',
staticAssetsPrefix: '<%= profile_data.webclient_static_assets_url_prefix %>',
communitiesUrlPrefix: '<%= profile_data.communities_url_prefix %>',
app: angular.module('wwtApp', [
'mgcrea.ngStrap',

Просмотреть файл

@ -58,7 +58,7 @@
}
root = wwt.wc.createFolder();
root.loadFromUrl('//worldwidetelescope.org/Resource/Service/Payload', function () {
root.loadFromUrl(wwt.communitiesUrlPrefix + '/Resource/Service/Payload', function () {
deferred.resolve(root.get_children());
});
}

Просмотреть файл

@ -6,5 +6,6 @@
webclient_static_assets_url_prefix: ''
userweb_url_prefix: https://beta.worldwidetelescope.org
communities_url_prefix: https://beta.worldwidetelescope.org
webgl_engine_url_prefix: https://beta.worldwidetelescope.org/engine/latest # no CDN to avoid staleness issues
maybe_min: ''

Просмотреть файл

@ -13,6 +13,12 @@ webclient_static_assets_url_prefix: https://beta-cdn.worldwidetelescope.org/webc
# served from /webclient/ and they're in the root, so:
userweb_url_prefix: ..
# A prefix to prepend to paths for links to the WWT Communities, which will look
# like "/Resource" before prefixing. On the production server, the Communities
# and "user website" are both in the same place, but in testing we might split
# them out.
communities_url_prefix: ..
# The URL prefix for finding the Web engine. In production, we want to route
# this through the CDN. In development we want to use the testing version or
# perhaps even a local hacked version.