This commit is contained in:
Marek Lenczewski
2026-04-07 17:55:30 +02:00
parent 8f15f51bce
commit ca988345e9
19 changed files with 201 additions and 203 deletions

View File

@@ -1,11 +1,11 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from api.profile_controller import router as profiles_router
from api.video_controller import router as videos_router
from database.database import SessionLocal, create_tables
from api.profile_controller import router as profilesRouter
from api.video_controller import router as videosRouter
from database.database import SessionLocal, createTables
from model.profile import Profile
from notify.notify_clients import register_websocket
from notify.notify_clients import registerWebsocket
app = FastAPI()
@@ -16,14 +16,14 @@ app.add_middleware(
allow_headers=["*"],
)
app.include_router(videos_router)
app.include_router(profiles_router)
register_websocket(app)
app.include_router(videosRouter)
app.include_router(profilesRouter)
registerWebsocket(app)
@app.on_event("startup")
def startup():
create_tables()
createTables()
db = SessionLocal()
if db.query(Profile).count() == 0:
db.add(Profile(name="Standard"))