asgi.py 411 Bytes
Newer Older
1
from fastapi import FastAPI
2
3
4
5
6
from starlette.middleware.sessions import SessionMiddleware

import aurweb.config

from aurweb.routers import sso
7
8

app = FastAPI()
9
10
11
12
13
14
15
16

session_secret = aurweb.config.get("fastapi", "session_secret")
if not session_secret:
    raise Exception("[fastapi] session_secret must not be empty")

app.add_middleware(SessionMiddleware, secret_key=session_secret)

app.include_router(sso.router)