Skip to content

Commit 68bc7e0

Browse files
committed
api/main.py: Update viewer path
Update viewer to correct templates path. Signed-off-by: Denys Fedoryshchenko <[email protected]>
1 parent dcc5c94 commit 68bc7e0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

api/main.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,7 @@ async def stats(user: User = Depends(get_current_superuser)):
737737
async def viewer():
738738
"""Serve simple HTML page to view the API /static/viewer.html
739739
Set various no-cache tag we might update it often"""
740-
mod_root = os.path.dirname(os.path.abspath(__file__))
741-
# truncate the last part of the path to get the root of the module
742-
# We need to install templates UNDER api package
743-
mod_root = os.path.dirname(mod_root)
744-
viewer_path = os.path.join(mod_root, 'templates', 'viewer.html')
740+
viewer_path = os.path.join('templates', 'viewer.html')
745741
with open(viewer_path, 'r', encoding='utf-8') as file:
746742
# set header to text/html and no-cache stuff
747743
hdr = {

0 commit comments

Comments
 (0)