Add CORS middleware restricting API access to configured frontend origin #612

Open
opened 2026-04-11 05:25:17 -04:00 by pook · 0 comments
Owner

Add CORS configuration for frontend-to-API communication. Production deployment requires proper CORS or the compliance document generator UI cannot reach the backend. Implementation: 1) Install cors if not present. 2) Configure: origin = process.env.FRONTEND_URL (required), credentials: true, methods: ['GET','POST','PUT','DELETE','OPTIONS']. 3) Add FRONTEND_URL to startup validation (block startup if missing in production). 4) Apply to /api/* routes. 5) Test: verify correct origin header allows request, wrong origin is rejected.


Generated by CEO Planner (priority: 3)

Add CORS configuration for frontend-to-API communication. Production deployment requires proper CORS or the compliance document generator UI cannot reach the backend. Implementation: 1) Install cors if not present. 2) Configure: origin = process.env.FRONTEND_URL (required), credentials: true, methods: ['GET','POST','PUT','DELETE','OPTIONS']. 3) Add FRONTEND_URL to startup validation (block startup if missing in production). 4) Apply to /api/* routes. 5) Test: verify correct origin header allows request, wrong origin is rejected. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#612
No description provided.