refactor: migrate main.py to modular routers and add project roadmap
- Migrated monolithic main.py to feature-scoped routers in app/routers/ - Added GEMINI.md for project context and AI instructional guidelines - Updated README.md with a comprehensive modernization plan (SQL migration, robust scraping DSL, frontend modernization) - Improved authentication with cookie support and modular JS - Updated test suite and documentation
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
Static pages routes for Ohm Stream Downloader API.
|
||||
"""
|
||||
|
||||
from fastapi import APIRouter, Request
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
||||
router = APIRouter(tags=["static"])
|
||||
|
||||
|
||||
def get_templates():
|
||||
from main import templates
|
||||
|
||||
return templates
|
||||
|
||||
|
||||
@router.get("/web")
|
||||
async def web_interface(request: Request):
|
||||
"""Web interface"""
|
||||
templates = get_templates()
|
||||
return templates.TemplateResponse("index.html", {"request": request})
|
||||
|
||||
|
||||
@router.get("/login")
|
||||
async def login_page(request: Request):
|
||||
"""Login/Register page"""
|
||||
templates = get_templates()
|
||||
return templates.TemplateResponse("login.html", {"request": request})
|
||||
|
||||
|
||||
@router.get("/watchlist")
|
||||
async def watchlist_redirect():
|
||||
"""Redirect /watchlist to web interface with watchlist hash"""
|
||||
return RedirectResponse("/web#watchlist")
|
||||
Reference in New Issue
Block a user