Home
Support Forums

GET/POST Requests React on Netlify

Hey,
When my FrontEnd(React) is up on my localhost I can send to get/post req to the server, and when I do the same requests with the same code on Netlify is not working… I spend 2 weeks on this problem without success, I feel lost, help anybody?

Hiya @niroavram!

We’re going to have to see some code to help. Would you might sharing the repository?

Hiya @snorkypie !
http://www.beenyan.com this is the site,
the request send from package-json by “proxy”: “http://localhost:5000” (or Other IP)
{

“name”: “client”,

“version”: “0.1.0”,

“private”: true,

“proxy”: “http://localhost:5000”,

“secure”: false,

“dependencies”: {

"@testing-library/jest-dom": "^4.2.4",

"@testing-library/react": "^9.5.0",

"@testing-library/user-event": "^7.2.1",

"cors": "^2.8.5",

"http-proxy-middleware": "^1.0.6",

"materialize-css": "^1.0.0-rc.2",

"react": "^16.13.1",

"react-dom": "^16.13.1",

"react-router-dom": "^5.2.0",

"react-scripts": "^4.0.2"

},

“scripts”: {

"start": "react-scripts start",

"build": "react-scripts build",

"test": "react-scripts test",

"eject": "react-scripts eject"

},

“eslintConfig”: {

"extends": "react-app"

},

“browserslist”: {

"production": [

  ">0.2%",

  "not dead",

  "not op_mini all"

],

"development": [

  "last 1 chrome version",

  "last 1 firefox version",

  "last 1 safari version"

]

}

}

Hi, @niroavram. It look like that proxy is a node service you run. If so, the following support guide explains why it doesn’t work:

If you have questions after reading that support guide, please let us know.