CORS support when building an API

Hello everyone,

I’m building an API with Powershell Universal, and a frontend fetching data from this API.
I’m struggling with CORS errors, is there any way to enable CORS in Powershell Universal?

Thanks in advance,
William

We provide some basic CORS support by that allow you to specify which hosts are allowed.

In appsettings.json, you can customize the CorsHosts setting. All hosts listed will have full CORS access enabled.

  "CorsHosts": "",