feat: Implement static login page and fix server errors
This commit is contained in:
7
main.py
7
main.py
@@ -1,7 +1,7 @@
|
||||
from fastapi import FastAPI
|
||||
from starlette.middleware.sessions import SessionMiddleware
|
||||
from starlette.staticfiles import StaticFiles
|
||||
from starlette.responses import HTMLResponse
|
||||
from starlette.responses import FileResponse
|
||||
|
||||
import models
|
||||
from database import engine
|
||||
@@ -26,6 +26,5 @@ app.include_router(auth.router)
|
||||
app.add_middleware(SessionMiddleware, secret_key=settings.ENCRYPTION_KEY)
|
||||
|
||||
@app.get("/")
|
||||
async def read_root() -> HTMLResponse:
|
||||
with open("static/login.html") as f:
|
||||
return HTMLResponse(content=f.read(), status_code=200)
|
||||
async def read_root():
|
||||
return FileResponse("static/login.html")
|
||||
Reference in New Issue
Block a user