We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 628a6d6 commit f4519acCopy full SHA for f4519ac
api/main.py
@@ -714,6 +714,21 @@ async def stats(user: User = Depends(get_current_superuser)):
714
return await pubsub.subscription_stats()
715
716
717
+@app.get('/viewer')
718
+async def viewer():
719
+ """Serve simple HTML page to view the API /static/viewer.html
720
+ Set various no-cache tag we might update it often"""
721
+ with open('api/viewer.html', 'r', encoding='utf-8') as file:
722
+ # set header to text/html and no-cache stuff
723
+ hdr = {
724
+ 'Content-Type': 'text/html',
725
+ 'Cache-Control': 'no-cache, no-store, must-revalidate',
726
+ 'Pragma': 'no-cache',
727
+ 'Expires': '0'
728
+ }
729
+ return PlainTextResponse(file.read(), headers=hdr)
730
+
731
732
versioned_app = VersionedFastAPI(
733
app,
734
version_format='{major}',
0 commit comments