Update: Building start of login page, based on previous attempt.

This commit is contained in:
2025-11-17 00:34:13 +01:00
parent 3827744154
commit c4edd88b71
2 changed files with 28 additions and 2 deletions

10
main.py
View File

@@ -1,5 +1,7 @@
from fastapi import FastAPI
from starlette.middleware.sessions import SessionMiddleware
from starlette.staticfiles import StaticFiles
from starlette.responses import HTMLResponse
import models
from database import engine
@@ -13,6 +15,9 @@ models.Base.metadata.create_all(bind=engine)
app = FastAPI()
# Mount the 'static' directory to serve files like login.html
app.mount("/static", StaticFiles(directory="static"), name="static")
# Add the authentication router
app.include_router(auth.router)
@@ -21,5 +26,6 @@ app.include_router(auth.router)
app.add_middleware(SessionMiddleware, secret_key=settings.ENCRYPTION_KEY)
@app.get("/")
async def read_root():
return {"message": "MultiChatOverlay API"}
async def read_root() -> HTMLResponse:
with open("static/login.html") as f:
return HTMLResponse(content=f.read(), status_code=200)