Update: Building start of login page, based on previous attempt.
This commit is contained in:
20
login.html
Normal file
20
login.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Login - MultiChatOverlay</title>
|
||||||
|
<style>
|
||||||
|
body { font-family: sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f2f5; margin: 0; }
|
||||||
|
.login-container { text-align: center; padding: 40px; background-color: white; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
|
||||||
|
.twitch-btn { display: inline-block; background-color: #9146FF; color: white; padding: 10px 20px; border-radius: 5px; text-decoration: none; font-weight: bold; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="login-container">
|
||||||
|
<h1>Welcome to MultiChatOverlay</h1>
|
||||||
|
<p>Connect your streaming accounts to get started.</p>
|
||||||
|
<a href="/login/twitch" class="twitch-btn">Login with Twitch</a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
10
main.py
10
main.py
@@ -1,5 +1,7 @@
|
|||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from starlette.middleware.sessions import SessionMiddleware
|
from starlette.middleware.sessions import SessionMiddleware
|
||||||
|
from starlette.staticfiles import StaticFiles
|
||||||
|
from starlette.responses import HTMLResponse
|
||||||
|
|
||||||
import models
|
import models
|
||||||
from database import engine
|
from database import engine
|
||||||
@@ -13,6 +15,9 @@ models.Base.metadata.create_all(bind=engine)
|
|||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
|
# Mount the 'static' directory to serve files like login.html
|
||||||
|
app.mount("/static", StaticFiles(directory="static"), name="static")
|
||||||
|
|
||||||
# Add the authentication router
|
# Add the authentication router
|
||||||
app.include_router(auth.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.add_middleware(SessionMiddleware, secret_key=settings.ENCRYPTION_KEY)
|
||||||
|
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def read_root():
|
async def read_root() -> HTMLResponse:
|
||||||
return {"message": "MultiChatOverlay API"}
|
with open("static/login.html") as f:
|
||||||
|
return HTMLResponse(content=f.read(), status_code=200)
|
||||||
Reference in New Issue
Block a user