Redirect HTTP requests to /index.html for React app

Hi All,

If Node-RED is used to host a single page React webapp as static content at a top level domain, with an api running at /api, is it possible to redirect all non-API requests back to /index.html so they can be processed by the single page app?


like a middle ware? You'd have to pass each request through a function node with your middle ware logic inside of it.

it would be straightforward to set up a redirect inside Node-RED, but with httpNodeRoot set to /api in settings.js we can only capture requests to /api endpoints inside Node-RED.

httpStatic serves content from the top level, so I'm thinking it would need an additional config applied to the express webserver?

Have a look at uibuilder and see if that helps. You can use it with REACT.