IONIC 3 CORS ISSUE

后端 未结 7 2400
小蘑菇
小蘑菇 2020-12-09 18:16

I am having a CORS issue with Ionic 3 when attempting to make GET calls to an API. I am using Ionic local server, running ionic serve in the command line for li

7条回答
  •  生来不讨喜
    2020-12-09 18:59

    To test in development environment, you can run Google Chrome in disable-web-security mode.

    Steps to follow (On Windows)

    • Press Windows Key + R to open Run window.
    • Enter/input following command and press Enter key.

    chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security

    Steps to follow (On Ubuntu)

    • Kill all the chrome.exe instances before you run/execute it.

    chromium-browser --disable-web-security --user-data-dir="[some directory here]"

    • Before Chrome 48

    chromium-browser --disable-web-security

    Steps to follow (On Mac)

    • Run following command in terminal.

    open -n -a "Google Chrome" --args --user-data-dir=/tmp/temp_chrome_user_data_dir http://localhost:8100/ --disable-web-security

提交回复
热议问题