So, basically React app is using react router for handling routes on a frontend side. On a backend side Express uses it's own router, with a distinction for WebApp(api and status) and ReactApp(/).
So, what's the problem. If you go to the main app route http://kyero-takebot.herokuapp.com/ everything works fine. If you click on a status your route will change to http://kyero-takebot.herokuapp.com/status which is also fine - frontend routing is working no backend involved. The problem occurs when you reload the page. Then it's not even hitting a frontend side because it's being catched by Express router and page is returning you a ok 200 instead of the react page.
In order to avoid it we can
a) Hide everything related to the react app under the app/* route
b) change a content type of the request for status
whatever suits you @LynxEyes
So, basically React app is using react router for handling routes on a frontend side. On a backend side Express uses it's own router, with a distinction for WebApp(
apiandstatus) and ReactApp(/).So, what's the problem. If you go to the main app route
http://kyero-takebot.herokuapp.com/everything works fine. If you click on a status your route will change tohttp://kyero-takebot.herokuapp.com/statuswhich is also fine - frontend routing is working no backend involved. The problem occurs when you reload the page. Then it's not even hitting a frontend side because it's being catched by Express router and page is returning you aok 200instead of the react page.In order to avoid it we can
a) Hide everything related to the react app under the
app/*routeb) change a content type of the request for
statuswhatever suits you @LynxEyes