From b28547df2025afb7b5d8941e5553865ff5dc29a6 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 12 Apr 2021 16:11:42 -0700 Subject: web: consistent public API URLs --- python/fatcat_web/templates/changelog.html | 6 +----- python/fatcat_web/templates/editgroup_view.html | 2 +- python/fatcat_web/templates/entity_history.html | 2 +- python/fatcat_web/templates/entity_macros.html | 7 +------ python/fatcat_web/templates/entity_view_metadata.html | 2 +- python/fatcat_web/web_config.py | 4 ++++ 6 files changed, 9 insertions(+), 14 deletions(-) (limited to 'python') diff --git a/python/fatcat_web/templates/changelog.html b/python/fatcat_web/templates/changelog.html index 3ad01d63..59630666 100644 --- a/python/fatcat_web/templates/changelog.html +++ b/python/fatcat_web/templates/changelog.html @@ -37,11 +37,7 @@ inspect every change all the way back to the start.
- {% if config.FATCAT_DOMAIN == "fatcat.wiki" %} - As JSON via API - {% else %} - As JSON via API - {% endif %} + As JSON via API
{% endblock %} diff --git a/python/fatcat_web/templates/editgroup_view.html b/python/fatcat_web/templates/editgroup_view.html index 6a9793f7..e1af719d 100644 --- a/python/fatcat_web/templates/editgroup_view.html +++ b/python/fatcat_web/templates/editgroup_view.html @@ -181,7 +181,7 @@ {{ edit_list(auth_to, editgroup, editgroup.edits.webcaptures, "webcapture", "Web Capture") }}
- As JSON via API + As JSON via API

diff --git a/python/fatcat_web/templates/entity_history.html b/python/fatcat_web/templates/entity_history.html index 0115b845..05fae0c3 100644 --- a/python/fatcat_web/templates/entity_history.html +++ b/python/fatcat_web/templates/entity_history.html @@ -35,7 +35,7 @@ This table only shows accepted edits included in the catalog, not any wor {% endfor %}
- As JSON via API + As JSON via API
diff --git a/python/fatcat_web/templates/entity_macros.html b/python/fatcat_web/templates/entity_macros.html index 9207bd48..4b0635e5 100644 --- a/python/fatcat_web/templates/entity_macros.html +++ b/python/fatcat_web/templates/entity_macros.html @@ -36,12 +36,7 @@
Revision: {{ entity.revision }} {% endif %}
API URL: - As JSON via API + As JSON via API {% if entity.extra %} diff --git a/python/fatcat_web/web_config.py b/python/fatcat_web/web_config.py index 25c93114..3dba933d 100644 --- a/python/fatcat_web/web_config.py +++ b/python/fatcat_web/web_config.py @@ -22,6 +22,10 @@ class Config(object): FATCAT_DOMAIN = os.environ.get("FATCAT_DOMAIN", default="dev.fatcat.wiki") FATCAT_API_AUTH_TOKEN = os.environ.get("FATCAT_API_AUTH_TOKEN", default=None) FATCAT_API_HOST = os.environ.get("FATCAT_API_HOST", default="https://{}/v0".format(FATCAT_DOMAIN)) + public_host_default = f"https://{FATCAT_DOMAIN}/v0" + if FATCAT_DOMAIN == "dev.fatcat.wiki": + public_host_default = FATCAT_API_HOST + FATCAT_PUBLIC_API_HOST = os.environ.get("FATCAT_PUBLIC_API_HOST", default=public_host_default) # can set this to https://search.fatcat.wiki for some experimentation ELASTICSEARCH_BACKEND = os.environ.get("ELASTICSEARCH_BACKEND", default="http://localhost:9200") -- cgit v1.2.3