bep40 commited on
Commit
4e22382
·
verified ·
1 Parent(s): 6913c45

Serve index.html with tv_player.js

Browse files
Files changed (1) hide show
  1. app_v2_entry.py +3 -2
app_v2_entry.py CHANGED
@@ -424,8 +424,9 @@ def _get_hot_topics():
424
  def api_hot_topics():return JSONResponse({'topics':_get_hot_topics()})
425
  @app.get('/')
426
  async def serve_index():
427
- p=os.path.join(STATIC_DIR,'index_v3.html')
428
- if os.path.exists(p):return FileResponse(p,media_type='text/html')
 
429
  return HTMLResponse('<h1>VNEWS</h1>')
430
  @app.get('/api/hashtag/sources')
431
  def _ht(topic:str=Query(...),page:int=Query(default=0)):
 
424
  def api_hot_topics():return JSONResponse({'topics':_get_hot_topics()})
425
  @app.get('/')
426
  async def serve_index():
427
+ for name in ['index.html','index_v3.html','index_v2.html']:
428
+ p=os.path.join(STATIC_DIR,name)
429
+ if os.path.exists(p):return FileResponse(p,media_type='text/html')
430
  return HTMLResponse('<h1>VNEWS</h1>')
431
  @app.get('/api/hashtag/sources')
432
  def _ht(topic:str=Query(...),page:int=Query(default=0)):