From 295e05317a7ea79fac182bbbdcc80a88213c8cfe Mon Sep 17 00:00:00 2001 From: Jacob Windsor Date: Wed, 19 Feb 2025 12:52:23 +0100 Subject: [PATCH] Create the DB --- backend/app/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/app/main.py b/backend/app/main.py index 81b4bf2..ef80afd 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -1,6 +1,15 @@ from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware +from .providers.db_provider import create_db_and_tables + +from contextlib import asynccontextmanager + +@asynccontextmanager +async def lifespan(_app: FastAPI): + create_db_and_tables() + yield + app = FastAPI( title="Fair Housing API", description="Provides access to core functionality for the fair housing platform.",