Dan Walsh commited on
Commit
59ea016
·
1 Parent(s): b089011

Updating dev/prod environment setups

Browse files
__pycache__/main.cpython-311.pyc CHANGED
Binary files a/__pycache__/main.cpython-311.pyc and b/__pycache__/main.cpython-311.pyc differ
 
app/services/__pycache__/summariser.cpython-311.pyc CHANGED
Binary files a/app/services/__pycache__/summariser.cpython-311.pyc and b/app/services/__pycache__/summariser.cpython-311.pyc differ
 
main.py CHANGED
@@ -2,21 +2,18 @@ from fastapi import FastAPI
2
  from fastapi.middleware.cors import CORSMiddleware
3
  import os
4
 
5
- # Import the router from the correct location
6
- # Check which router file exists and use that one
7
- if os.path.exists("app/api/routes.py"):
8
- from app.api.routes import router as api_router
9
- elif os.path.exists("app/routers/api.py"):
10
- from app.routers.api import router as api_router
11
- else:
12
- raise ImportError("Could not find router file")
13
 
14
  app = FastAPI(title="AI Content Summariser API")
15
 
16
- # Configure CORS - allow requests from the frontend
17
  app.add_middleware(
18
  CORSMiddleware,
19
- allow_origins=["*"], # For development - restrict this in production
 
 
 
20
  allow_credentials=True,
21
  allow_methods=["*"],
22
  allow_headers=["*"],
 
2
  from fastapi.middleware.cors import CORSMiddleware
3
  import os
4
 
5
+ # Import the router
6
+ from app.api.routes import router as api_router
 
 
 
 
 
 
7
 
8
  app = FastAPI(title="AI Content Summariser API")
9
 
10
+ # Configure CORS
11
  app.add_middleware(
12
  CORSMiddleware,
13
+ allow_origins=[
14
+ "https://ai-content-summariser.vercel.app",
15
+ "http://localhost:3000",
16
+ ],
17
  allow_credentials=True,
18
  allow_methods=["*"],
19
  allow_headers=["*"],