Add route for /favicon.ico to fix missing favicon (#6815)

This commit is contained in:
Mitchell Stern
2020-01-16 19:03:21 -08:00
committed by Edward Oakes
parent 232be5a058
commit 8e8b66a4b8
+7
View File
@@ -128,6 +128,12 @@ class Dashboard(object):
os.path.dirname(os.path.abspath(__file__)),
"client/build/index.html"))
async def get_favicon(req) -> aiohttp.web.Response:
return aiohttp.web.FileResponse(
os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"client/build/favicon.ico"))
async def json_response(result=None, error=None,
ts=None) -> aiohttp.web.Response:
if ts is None:
@@ -249,6 +255,7 @@ class Dashboard(object):
return await json_response(result=result)
self.app.router.add_get("/", get_index)
self.app.router.add_get("/favicon.ico", get_favicon)
static_dir = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "client/build/static")