mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-07 01:48:11 +08:00
Set API path based on access address (#568)
* Make api paths relative * Remove request import * Set publicPath to be relative
This commit is contained in:
committed by
Charlotte Weaver
parent
b6f946ec8a
commit
0f8d7a55de
@@ -10,7 +10,7 @@ const nodeModules = path.resolve("node_modules");
|
|||||||
|
|
||||||
const babelOptions = require("../babel/babel.prod");
|
const babelOptions = require("../babel/babel.prod");
|
||||||
|
|
||||||
const publicPath = "/";
|
const publicPath = "";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: "production",
|
mode: "production",
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.CELLXGENE = {};
|
window.CELLXGENE = {};
|
||||||
window.CELLXGENE.API = {
|
window.CELLXGENE.API = {
|
||||||
prefix: "{{ prefix | safe }}",
|
prefix: window.location.href + "api/",
|
||||||
version: "v0.2/"
|
version: "v0.2/"
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
<script>
|
<script>
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
const ui = SwaggerUIBundle({
|
const ui = SwaggerUIBundle({
|
||||||
url: window.location.origin + "/api/swagger.json",
|
url: window.location.href.replace(/\/swagger$/, "") + "/api/swagger.json",
|
||||||
dom_id: '#swagger-ui',
|
dom_id: '#swagger-ui',
|
||||||
deepLinking: true,
|
deepLinking: true,
|
||||||
presets: [
|
presets: [
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
from flask import Blueprint, render_template, send_from_directory, current_app, request
|
from flask import Blueprint, render_template, send_from_directory, current_app
|
||||||
|
|
||||||
|
|
||||||
bp = Blueprint("webapp", __name__, template_folder="templates")
|
bp = Blueprint("webapp", __name__, template_folder="templates")
|
||||||
@@ -7,9 +7,8 @@ bp = Blueprint("webapp", __name__, template_folder="templates")
|
|||||||
|
|
||||||
@bp.route("/")
|
@bp.route("/")
|
||||||
def index():
|
def index():
|
||||||
url_base = request.url_root + "api/"
|
|
||||||
dataset_title = current_app.config["DATASET_TITLE"]
|
dataset_title = current_app.config["DATASET_TITLE"]
|
||||||
return render_template("index.html", prefix=url_base, datasetTitle=dataset_title)
|
return render_template("index.html", datasetTitle=dataset_title)
|
||||||
|
|
||||||
|
|
||||||
# renders swagger documentation
|
# renders swagger documentation
|
||||||
|
|||||||
Reference in New Issue
Block a user