mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-02 10:58:11 +08:00
Use url_root from Flask rather than hardcoding hostname. (#520)
Allows running in a container on a remote host, should also allow running behind a proxy with a url prefix.
This commit is contained in:
committed by
Charlotte Weaver
parent
bd523280a4
commit
f2eb2cad82
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
from flask import Blueprint, render_template, send_from_directory, current_app
|
||||
from flask import Blueprint, render_template, send_from_directory, current_app, request
|
||||
|
||||
|
||||
bp = Blueprint("webapp", __name__, template_folder="templates")
|
||||
@@ -7,7 +7,7 @@ bp = Blueprint("webapp", __name__, template_folder="templates")
|
||||
|
||||
@bp.route("/")
|
||||
def index():
|
||||
url_base = current_app.config["CXG_API_BASE"]
|
||||
url_base = request.url_root + "api/"
|
||||
dataset_title = current_app.config["DATASET_TITLE"]
|
||||
return render_template("index.html", prefix=url_base, datasetTitle=dataset_title)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user