INNER CODE UNIT · Python

lifespan

infobyte/emploleaks · webapp/backend/main.py:10

async def lifespan(app: FastAPI):
    async with get_db() as db:
        await ensure_columns(db)
    yield


app = FastAPI(title="EmploLeaks API", version="1.0.0", lifespan=lifespan)

app.add_middleware(
    CORSMiddleware,
    allow_origins=["http://localhost:3421"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

app.include_router(companies.router, prefix="/api")
app.include_router(dashboard.router, prefix="/api")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…