d4d8d8a3b6
- 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
35 lines
827 B
Python
35 lines
827 B
Python
"""
|
|
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")
|