Skip to content

Commit

Permalink
core:update CORS configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
malachsalama committed Feb 23, 2025
1 parent 5cf946e commit e4c4681
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,29 @@

app = FastAPI()

# Define the allowed origins
allowed_origins = [
"https://telex.im",
"https://staging.telex.im",
"https://telextest.im",
"https://staging.telextest.im"
]

# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_origins=allowed_origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)

# Include routers
app.include_router(integration_router, prefix=settings.API_PREFIX)
app.include_router(webhook_router, prefix=settings.API_PREFIX)


# Health check endpoint
@app.get("/healthcheck")
async def health_check():
"""Checks if server is active."""
return {"status": "active"}
return {"status": "active"}

0 comments on commit e4c4681

Please sign in to comment.