evoluteur/evolutility-ui-react

Use proxy feature instead of hard-coded URL literals to access API

david-pfx opened this issue · 1 comments

React can pass through API calls using a 'proxy' feature.

In package.json:

"proxy": "http://localhost:2000/",

In config.js

apiPath: '/api/v1/',
filesUrl: '/pix/',

See https://www.fullstackreact.com/articles/using-create-react-app-with-a-server/ for some discussion, and a tutorial that nearly works!

Done.