Ali2206 commited on
Commit
046255d
·
verified ·
1 Parent(s): cee9c20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import uvicorn
2
  from fastapi import FastAPI
3
  from fastapi.middleware.cors import CORSMiddleware
4
- from config import setup_app, agent, logger, patients_collection, analysis_collection, users_collection, notifications_collection
5
  from endpoints import create_router
6
 
7
  # Create the FastAPI app
@@ -10,7 +10,7 @@ app = FastAPI(title="TxAgent API", version="2.6.0")
10
  # Apply CORS middleware
11
  app.add_middleware(
12
  CORSMiddleware,
13
- allow_origins=["*"], # Adjust for production (e.g., specific origins)
14
  allow_credentials=True,
15
  allow_methods=["*"],
16
  allow_headers=["*"]
@@ -19,8 +19,8 @@ app.add_middleware(
19
  # Setup the app (e.g., initialize globals, startup event)
20
  setup_app(app)
21
 
22
- # Include the router with dependencies
23
- router = create_router(agent, logger, patients_collection, analysis_collection, users_collection, notifications_collection)
24
  app.include_router(router)
25
 
26
  if __name__ == "__main__":
 
1
  import uvicorn
2
  from fastapi import FastAPI
3
  from fastapi.middleware.cors import CORSMiddleware
4
+ from config import setup_app, agent, logger, patients_collection, analysis_collection, users_collection
5
  from endpoints import create_router
6
 
7
  # Create the FastAPI app
 
10
  # Apply CORS middleware
11
  app.add_middleware(
12
  CORSMiddleware,
13
+ allow_origins=["*"],
14
  allow_credentials=True,
15
  allow_methods=["*"],
16
  allow_headers=["*"]
 
19
  # Setup the app (e.g., initialize globals, startup event)
20
  setup_app(app)
21
 
22
+ # Create and include the router with dependencies
23
+ router = create_router(agent, logger, patients_collection, analysis_collection, users_collection)
24
  app.include_router(router)
25
 
26
  if __name__ == "__main__":