@@ -54,7 +54,7 @@ async def lifespan(app: FastAPI):
5454    current_path  =  Path (__file__ ).parent 
5555    cfg  =  Config (os .path .join (current_path , "alembic.ini" ))
5656    # Change DB URL to use psycopg2 driver for this specific check 
57-     db_url  =  str (settings .SQLALCHEMY_DATABASE_URI ).replace (
57+     db_url  =  str (settings .DATABASE_URI ).replace (
5858        "postgresql+asyncpg://" , "postgresql+psycopg2://" 
5959    )
6060    script_location  =  cfg .get_main_option ("script_location" , "alembic" )
@@ -96,13 +96,7 @@ async def lifespan(app: FastAPI):
9696    logger .info ("CORS enabled for %s" , settings .BACKEND_CORS_ORIGINS )
9797    # origins = settings.BACKEND_CORS_ORIGINS.copy() 
9898    origins  =  str (settings .BACKEND_CORS_ORIGINS )
99-     if  (
100-         settings .CODESPACES 
101-         and  settings .CODESPACE_NAME 
102-         and  settings .ENVIRONMENT  ==  AppEnvironment .LOCAL 
103-     ):
104-         # add codespace origin if running in Github codespace 
105-         origins .append (f"https://{ settings .CODESPACE_NAME }  -3000.app.github.dev" )
99+     origins .append (settings .FRONTEND_HOST )
106100    # allow all origins 
107101    app .add_middleware (
108102        CORSMiddleware ,
@@ -119,8 +113,8 @@ async def lifespan(app: FastAPI):
119113        "http://127.0.0.1" ,
120114        "http://127.0.0.1:8000" ,
121115        "http://0.0.0.0" ,
122-         "http://localhost:5173" ,
123116    ]
117+     origins .append (settings .FRONTEND_HOST )
124118
125119    app .add_middleware (
126120        CORSMiddleware ,
@@ -132,11 +126,6 @@ async def lifespan(app: FastAPI):
132126
133127app .include_router (api_router , prefix = settings .API_PREFIX )
134128
135- # Mount the data files to serve the file viewer 
136- # mount_static_files("data", "/api/files/data") 
137- # Mount the output files from tools 
138- # mount_static_files("output", "/api/files/output") 
139- 
140129
141130def  start ():
142131    """Launched with `poetry run start` at root level""" 
0 commit comments