Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,20 @@ async def lifespan(app: FastAPI):
app = FastAPI(title="Jobflow API", lifespan=lifespan)

# CORS configuration
import os
origins = [
"http://localhost:3000", # For local development
]
if os.environ.get("ENVIRONMENT") == "production":
origins = [
"https://your-production-domain.com", # Replace with your production domain
]
app.add_middleware(
CORSMiddleware,
allow_origins=[
"chrome-extension://mnndnbaglhlkhbdpbfifhojlcmjcfife", # Your extension ID
"http://localhost:3000", # For local development
# Add other specific origins as needed
],
allow_credentials=True,
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allow_headers=["Content-Type", "Authorization"],
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allow_headers=["Content-Type", "Authorization"],
)

# Middleware for logging responses
Expand Down