COS301-SE-2024 / The-Republic

Imagine a fusion of ‘Eskom se Push’ and ‘X’. The Republic allows users to raise concerns and spread awareness about government services through incident reports, with cool data visualizations providing a dynamic overview of public sentiment on service delivery.
https://the-republic-six.vercel.app
7 stars 0 forks source link

Hotfix/cors fix #252

Closed hlokomani closed 1 month ago

hlokomani commented 1 month ago

Description:

This PR addresses CORS (Cross-Origin Resource Sharing) issues that were preventing proper communication between our frontend and backend, particularly in the local development environment.

Changes made:

  1. Updated the CORS middleware in app.ts to support multiple origins
  2. Added dynamic handling of the Access-Control-Allow-Origin header
  3. Included both localhost:3000 and our Vercel app URL in the list of allowed origins
  4. Ensured proper handling of preflight OPTIONS requests

Why this change is necessary:

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
the-republic ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2024 0:11am