gothinkster / react-redux-realworld-example-app

Exemplary real world application built with React + Redux
https://react-redux.realworld.io
MIT License
5.55k stars 2.5k forks source link

Application is not working with standalone backend #141

Closed 12masta closed 4 years ago

12masta commented 4 years ago

I am facing issue when trying to run app with local backend. If someone can help I will be very grateful. Steps to reproduce:

Preconditions:

Steps to reproduce:

  1. Run backend
  2. Edit src/agent.js and change API_ROOT to the local server's URL, in my case: http://localhost:5000/api
  3. npm install and npm start in project root directory

Actual results:

Expected results:

12masta commented 4 years ago

Tldr: replace api url in agent.js with http://localhost:5000 instead of http://localhost:5000/api

I think there is a bug in repo description, you can find following line:

If you want to change the API URL to a local server, simply edit src/agent.js and change API_ROOT to the local server's URL (i.e. http://localhost:3000/api)

But in this case web app trying to reach for tag endpoint with following url: http://localhost:3000/api/tags

Which is not valid, because tags endpoint is exposed under this url: http://localhost:3000/tags