Ionic3(Angular4) CORS on an emulator

后端 未结 1 426
别跟我提以往
别跟我提以往 2021-01-23 02:43

I\'m testing Ionic 3 app on a genymotion emulator. Btw http request doesn\'t work because of CORS. I thought that a sever has a problem. But I confirmed that a server has no pro

相关标签:
1条回答
  • 2021-01-23 03:19

    under your config.xml give the location of your localhost

    eg:

    <content src="http://10.10.1.1:8100" />
    <access origin="http://10.10.1.1:8100" />
    <allow-navigation href="http://10.10.1.1:8100" />
    

    further more make sure you add the proxy url under ionic.config.json

    "proxies": [{
            "path": "/rest",
            "proxyUrl": "http://10.10.10.1:8081/rest"
        }]
    
    0 讨论(0)
提交回复
热议问题