0

I have added the _redirects file in the public directory and I think the redirect is working as I'm getting a 200 status code in the network tab but the data is not showing up on the browser.

Network showed no error 200 status code

2 Answers2

0

Make sure you have not pushed your .env file to GitHub (in case you have it) because this might be the case of failure.

OR

Make sure you write it correctly Make a file inside the public directory named as _redirects. Inside it write a line of code /* /index.html 200

If this does not work then you need to share your code as well☺️

Shilpe Saxena
  • 219
  • 2
  • 8
  • Thank you yes I forgot to the hide the .env but that's fixed now. I don't believe that's the issue. I've added file to public as well as the alternative which is the Netlify toml file. Below is my package.json with the proxy. Mind you, it works fine when I run it on localhost. }, "devDependencies": { "@babel/core": "^7.18.10", "@babel/eslint-parser": "^7.18.9", "eslint": "^8.21.0", "http-proxy-middleware": "^2.0.6" }, "proxy": "https://api.yelp.com" } – TIGIST ALEMU Aug 06 '22 at 18:16
0

I finally found an answer! For anyone interested, please read the link below. https://docs.netlify.com/routing/redirects/rewrites-proxies/#proxy-to-another-service.

In my _redirects file I simply put in the proxy I was using. See below. Then add changes to git, redeploy

/* https://api.yelp.com/:splat 200

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 10 '22 at 02:19