Samfy001 commited on
Commit
8cd1e07
·
verified ·
1 Parent(s): 07bf29b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -299,9 +299,9 @@ _app = _FA(
299
 
300
  # CORS
301
  try:
302
- from fastapi.middleware.cors import CORSMiddleware as _CM
303
  _app.add_middleware(
304
- _CM,
305
  allow_origins=["*"],
306
  allow_credentials=True,
307
  allow_methods=["*"],
@@ -626,4 +626,4 @@ if __name__ == "__main__":
626
  except ImportError:
627
  _lg.error("uvicorn not installed. Install with: pip install uvicorn")
628
  except Exception as _e:
629
- _lg.error(f"Failed to start server: {_e}")
 
299
 
300
  # CORS
301
  try:
302
+ from fastapi.middleware.cors import CORSMiddleware as _CORS
303
  _app.add_middleware(
304
+ _CORS,
305
  allow_origins=["*"],
306
  allow_credentials=True,
307
  allow_methods=["*"],
 
626
  except ImportError:
627
  _lg.error("uvicorn not installed. Install with: pip install uvicorn")
628
  except Exception as _e:
629
+ _lg.error(f"Failed to start server: {_e}")