23 lines
526 B
Python
23 lines
526 B
Python
"""
|
|
应用官网主页路由
|
|
"""
|
|
from pathlib import Path
|
|
|
|
from fastapi import APIRouter
|
|
from fastapi.responses import HTMLResponse
|
|
|
|
router = APIRouter(tags=["home"])
|
|
|
|
_STATIC_DIR = Path(__file__).resolve().parent.parent / "static"
|
|
|
|
|
|
@router.get("/", response_class=HTMLResponse)
|
|
async def get_home():
|
|
"""
|
|
应用官网主页
|
|
|
|
包含应用介绍、功能展示、下载链接、定价方案等
|
|
"""
|
|
html_path = _STATIC_DIR / "home.html"
|
|
return HTMLResponse(content=html_path.read_text(encoding="utf-8"))
|