Connecting local program to Twitch dev-portal credentials

This commit is contained in:
2025-11-17 00:19:13 +01:00
parent 60417d4594
commit 264e4c276d
4 changed files with 123 additions and 1 deletions

10
main.py
View File

@@ -1,7 +1,10 @@
from fastapi import FastAPI
from starlette.middleware.sessions import SessionMiddleware
import models
from database import engine
import auth # Import the new auth module
from config import settings # Import settings to get the secret key
# This line tells SQLAlchemy to create all the tables based on the models
# we defined. It will create the `multichat_overlay.db` file with the
@@ -10,6 +13,13 @@ models.Base.metadata.create_all(bind=engine)
app = FastAPI()
# Add the authentication router
app.include_router(auth.router)
# Add session middleware. A secret key is required for signing the session cookie.
# We can reuse our encryption key for this, but in production you might want a separate key.
app.add_middleware(SessionMiddleware, secret_key=settings.ENCRYPTION_KEY)
@app.get("/")
async def read_root():
return {"message": "MultiChatOverlay API"}