added support for GATEWAY_EXTRA_SCRIPTS

This commit is contained in:
Alok Saldanha
2019-09-16 10:32:35 -04:00
parent 6183a7ed7d
commit 15998beb68
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -14,6 +14,7 @@ cellxgene_data = os.environ.get("CELLXGENE_DATA")
gateway_host = os.environ.get("GATEWAY_HOST")
gateway_protocol = os.environ.get("GATEWAY_PROTOCOL")
ip = os.environ.get("GATEWAY_IP")
extra_scripts = os.environ.get("GATEWAY_EXTRA_SCRIPTS")
env_vars = {
"CELLXGENE_LOCATION": cellxgene_location,
+2 -1
View File
@@ -7,10 +7,11 @@
# OR CONDITIONS OF ANY KIND, either express or implied. See the License for
# the specific language governing permissions and limitations under the License.
from cellxgene_gateway import env
def get_extra_scripts():
# can be array of script tags to inject on every page, e.g. for google analytics could be
# ['https://www.googletagmanager.com/gtag/js?id=UA-123456-2',
# f"{env.gateway_protocol}://{env.gateway_host}/static/js/google_ua.js"]
# where google_ua.js is a script you add to the static/js folder prior to deployment.
return []
return [] if env.extra_scripts is None else [p.strip() for p in env.extra_scripts.split(",") if len(p.strip()) > 0]