Commit b70ff373 authored by Jan Kyri's avatar Jan Kyri Committed by Tao Feng

Remove favicon path (#76)

* update requirements path & favicon path in api

* Update __init__.py

* Remove 'favicon' route

* Update __init__.py
parent 30a0b770
import os from typing import Any, Tuple
from typing import Any, IO, Tuple
from flask import Flask, render_template, send_from_directory from flask import Flask, render_template
from flask import current_app as app
def init_routes(app: Flask) -> None: def init_routes(app: Flask) -> None:
app.add_url_rule('/favicon.ico', 'favicon', favicon)
app.add_url_rule('/healthcheck', 'healthcheck', healthcheck) app.add_url_rule('/healthcheck', 'healthcheck', healthcheck)
app.add_url_rule('/', 'index', index, defaults={'path': ''}) # also functions as catch_all app.add_url_rule('/', 'index', index, defaults={'path': ''}) # also functions as catch_all
app.add_url_rule('/<path:path>', 'index', index) # catch_all app.add_url_rule('/<path:path>', 'index', index) # catch_all
...@@ -18,9 +15,3 @@ def index(path: str) -> Any: ...@@ -18,9 +15,3 @@ def index(path: str) -> Any:
def healthcheck() -> Tuple[str, int]: def healthcheck() -> Tuple[str, int]:
return '', 200 # pragma: no cover return '', 200 # pragma: no cover
def favicon() -> IO[bytes]:
""" TODO: Design team should provide us with a default icon """
return send_from_directory(os.path.join(app.root_path, 'static/images'),
'favicon.ico', mimetype='image/vnd.microsoft.icon') # pragma: no cover
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment