screenshot-to-code/screenshottocode/routes/home.py
2023-12-26 19:03:45 +00:00

18 lines
400 B
Python

from fastapi import APIRouter
from fastapi.responses import HTMLResponse
from pathlib import Path
router = APIRouter()
@router.get("/")
async def get_status():
html_path = Path(__file__, '..', '..', 'templates', 'index.html').resolve()
html_content = ''
with html_path.open('rt') as file:
html_content = file.read()
return HTMLResponse(
content=html_content
)