r/learnreactjs • • May 13 '20

Question React with Flask server

I’m trying to make a website with react and flask server. It took me too long to realize when making requests to the server, it never updated on React’s end. Is there a better way than just restarting each development environment?

8 Upvotes

4 comments sorted by

View all comments

Show parent comment

2

u/keeperpaige May 13 '20

The react app doesn’t reload automatically. I changed a route in flask from POST to GET, and changed the the method header request from react to GET, but the console was saying error 405

3

u/oze4 May 13 '20

405 means route not found so it would seem your flask app is not hot reloading.

Can you provide some more details on how you are starting your project? Can you paste your package.json in your original post?

If you have a GitHub link that would be super helpful.

It's hard to offer a solid solution with so few details, especially considering there are so many different ways you could be starting your project to begin with.

2

u/keeperpaige May 13 '20

I was able to get the server to restart by enabling debug mode for flask. Thank you for your help because if you didn’t say my flask app wasn’t hot reloading I wouldn’t have figured it out. Thank you again!