staticwebdev / blazor-starter

A starter template in C# APIs and Blazor for Azure Static Web Apps
217 stars 104 forks source link

Configure Cross-Origin Resource Sharing (CORS) locally #46

Open tan1193 opened 11 months ago

tan1193 commented 11 months ago

You won't have to worry about Cross-Origin Resource Sharing (CORS) when you publish to Azure Static Web Apps. Azure Static Web Apps automatically configure your app to communicate with your API on Azure using a reverse proxy. But when running locally, you need to configure CORS to allow your web app and API to communicate.

Now, prompt Azure Functions to allow your web app to request HTTP to the API on your computer.