From 7e41214aebd3507bf6e3d2ff29863fe6e3939489 Mon Sep 17 00:00:00 2001 From: majh Date: Thu, 11 Apr 2024 09:02:46 +0100 Subject: [PATCH] homepage just hosts openapi documentation instead of HTML --- polytope_server/frontend/flask_handler.py | 8 +---- polytope_server/frontend/web/css/style.css | 27 --------------- polytope_server/frontend/web/index.html | 38 ---------------------- 3 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 polytope_server/frontend/web/css/style.css delete mode 100644 polytope_server/frontend/web/index.html diff --git a/polytope_server/frontend/flask_handler.py b/polytope_server/frontend/flask_handler.py index d5dd9e5..9df8934 100644 --- a/polytope_server/frontend/flask_handler.py +++ b/polytope_server/frontend/flask_handler.py @@ -68,6 +68,7 @@ def create_handler( SWAGGER_URL, tmp.name, config={"app_name": "Polytope", "spec": spec} ) handler.register_blueprint(SWAGGERUI_BLUEPRINT, url_prefix=SWAGGER_URL) + handler.register_blueprint(SWAGGERUI_BLUEPRINT, url_prefix='/') data_transfer = DataTransfer(request_store, staging) @@ -92,13 +93,6 @@ def handle_error(error): for code, ex in default_exceptions.items(): handler.errorhandler(code)(handle_error) - @handler.route("/", methods=["GET"]) - def root(): - this_dir = os.path.dirname(os.path.abspath(__file__)) + "/" - with open(this_dir + "web/index.html") as fh: - content = fh.read() - return content - def get_auth_header(request): return request.headers.get("Authorization", "") diff --git a/polytope_server/frontend/web/css/style.css b/polytope_server/frontend/web/css/style.css deleted file mode 100644 index 5629028..0000000 --- a/polytope_server/frontend/web/css/style.css +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2022 European Centre for Medium-Range Weather Forecasts (ECMWF) - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -In applying this licence, ECMWF does not waive the privileges and immunities -granted to it by virtue of its status as an intergovernmental organisation nor -does it submit to any jurisdiction. -*/ - -.wide { - text-align: center; -} - -.wide h1 { - display: inline-block; -} diff --git a/polytope_server/frontend/web/index.html b/polytope_server/frontend/web/index.html deleted file mode 100644 index b578842..0000000 --- a/polytope_server/frontend/web/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - Polytope - - - -
-

Polytope

-

- This is an experimental service for EU projects, see - https://github.com/ecmwf-projects/polytope-server. -

-
- -