mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-16 21:37:59 +08:00
Allows running in a container on a remote host, should also allow running behind a proxy with a url prefix.
25 lines
652 B
Python
25 lines
652 B
Python
import os
|
|
from flask import Blueprint, render_template, send_from_directory, current_app, request
|
|
|
|
|
|
bp = Blueprint("webapp", __name__, template_folder="templates")
|
|
|
|
|
|
@bp.route("/")
|
|
def index():
|
|
url_base = request.url_root + "api/"
|
|
dataset_title = current_app.config["DATASET_TITLE"]
|
|
return render_template("index.html", prefix=url_base, datasetTitle=dataset_title)
|
|
|
|
|
|
# renders swagger documentation
|
|
@bp.route("/swagger")
|
|
def swag():
|
|
return render_template("swagger.html")
|
|
|
|
|
|
# renders swagger documentation
|
|
@bp.route("/favicon.png")
|
|
def favicon():
|
|
return send_from_directory(os.path.join(bp.root_path, "static/img/"), "favicon.png")
|