Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70432

Proxies not working

$
0
0

@johnmmackey wrote:

I am attempting to use service proxies as described in Service Proxies. However, I cannot get it to work at all. Note that is just browser dev/test - no devices involved. My configuration:

ionic.config.json:

{
  "name": "cgmobile",
  "integrations": {
    "capacitor": {}
  },
  "type": "react",
  "proxies": [
    {
      "path": "/api",
      "proxyUrl": "http://avalidhost.net:8090/"
    }
  ]
}

If I try the following:

curl localhost:8100/api/calendar

…or try to fetch the same URL from within my app, I just get the root html index file back. Note that this is a react app - a lot of the examples I can find online are angular… don’t see that matters though.

Configuration:
ionic cli version: 6.6.0
npm version: 6.13.4
node version: 12.15.0

Bits of output from ionic serve:

[react-scripts] ℹ 「wds」: Project is running at http://172.31.255.181/
[react-scripts] ℹ 「wds」: webpack output is served from 
[react-scripts] ℹ 「wds」: Content not from webpack is served from /home/john/Development/ionic/cgmobile/public
[react-scripts] ℹ 「wds」: 404s will fallback to /
[react-scripts] Starting the development server...
[react-scripts]


[INFO] Development server running!
       
       Local: http://localhost:8100
       
       Use Ctrl+C to quit this process

[INFO] Browser window opened to http://localhost:8100!

Dependencies section of package.json:

  "dependencies": {
    "@capacitor/core": "2.0.1",
    "@ionic/react": "^5.0.7",
    "@ionic/react-router": "^5.0.7",
    "@testing-library/jest-dom": "^5.5.0",
    "@testing-library/react": "^10.0.3",
    "@testing-library/user-event": "^10.1.0",
    "@types/jest": "^25.2.1",
    "@types/node": "^13.13.2",
    "@types/react": "^16.9.34",
    "@types/react-dom": "^16.9.6",
    "@types/react-router": "^5.1.5",
    "@types/react-router-dom": "^5.1.4",
    "ionicons": "^5.0.1",
    "moment": "^2.24.0",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-router": "^5.1.2",
    "react-router-dom": "^5.1.2",
    "react-scripts": "3.4.1",
    "rxjs": "^6.5.5",
    "typescript": "3.8.3",
    "weather-underground-icons": "^1.0.0"
  },

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70432

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>