We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dcc5c94 commit 68bc7e0Copy full SHA for 68bc7e0
api/main.py
@@ -737,11 +737,7 @@ async def stats(user: User = Depends(get_current_superuser)):
737
async def viewer():
738
"""Serve simple HTML page to view the API /static/viewer.html
739
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')
+ viewer_path = os.path.join('templates', 'viewer.html')
745
with open(viewer_path, 'r', encoding='utf-8') as file:
746
# set header to text/html and no-cache stuff
747
hdr = {
0 commit comments