fastapi: implement server with same back compatibility as before

This commit is contained in:
2023-07-29 15:59:25 +02:00
parent 3908c1ca53
commit 224afc6f28
5 changed files with 419 additions and 16 deletions

15
server/reflector/app.py Normal file
View File

@@ -0,0 +1,15 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from reflector.views.rtc_offer import router as rtc_offer_router
# build app
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["*"],
allow_headers=["*"],
)
# register views
app.include_router(rtc_offer_router)