[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[React.js] Route returns 404 on page refresh



Hi all, 


I have a React.js single-page app deployed to Openshift that uses its own router (e.g. /home, /about, /photos, etc.). Everything works fine (user navigating around my app) until the user refreshes the page. This in turn fires a GET request to the server, which it of course cannot resolve (404).

One solution I am using in "raw" k8s is for each endpoint I create a new path (i.e. /home, /about, /photos) inside an Ingress object, which is redirected to the web app Service [1].

Is there any solution for Openshift's Router? Maybe, a custom Router annotation that will redirect all requests to "/"?

Thanks a lot in advance.

[1] https://github.com/maslick/barkoder/blob/master/deployment/k8s-barkoder-ingress.yaml

Regards,
Pavel Maslov, MS

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]