Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Help on CORS #5566


User avatar
0
ajayak created

Hi,

I am planning to create an ionic capacitor app on top of AspNetZero Angular frontend. For the app to work, I need to enable CORS.

The capacitor wraps the app in a webview and runs the app localhost:9222. Should I just add this URL to the CORS list in appsettings.json? Is this a good approach?


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Yes, CorsOrigins is this feature.

  • User Avatar
    0
    ajayak created

    <cite>maliming: </cite> Yes, CorsOrigins is this feature.

    Yes! What value should I set in CorsOrigin?

  • User Avatar
    0
    maliming created
    Support Team

    :) "CorsOrigins": "http://*.mycompany.com,http://localhost:4200,http://localhost:49152,http://localhost:9222"

  • User Avatar
    0
    ajayak created

    <cite>maliming: </cite> :) "CorsOrigins": "http://*.mycompany.com,http://localhost:4200,http://localhost:49152,http://localhost:9222"

    Hehehe Thanks @maliming :D