Hi I want to change my loading of react in my local computer from localhost to some IP that matches my backend API, I tried all suggested options on the internet like using a proxy in package.json or using
"scripts": {
**"start": "HOST=http://127.0.0.1 react-scripts start",**
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
nothing working rather it's giving error like
(node:28360) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:28360) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
/media/as/Learn/Practice/Practice project/mern fulllstack/ECOMMERCE/frontend/node_modules/webpack-dev-server/lib/Server.js:2429
throw error;
^
Error: getaddrinfo ENOTFOUND http://127.0.0.1
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'http://127.0.0.1'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `HOST=http://127.0.0.1 react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/as/.npm/_logs/2022-07-23T05_00_21_832Z-debug.log