I'm wanting to use react-ssr as a sub app in a larger web application. Currently, there is an assumption that react-ssr is configure for the root path of a website.
From what I can tell, there are three issues to overcome for this to be possible:
The HTML templates created in the stringify folder assume that the react-ssr resources does not need a prefix.
The middleware proxy in development mode cannot be configured for incoming paths to have a prefix
Only the first item is required for running in production and this can be achieved by providing a redirect on the server. I made a gist as an example.
If I could provide custom options to http-proxy-middleware, this would let me have a development environment for my app. I would use the custom config to provide a pathRewrite option.
What do you think? I'll raise a PR so you can see.
I'm wanting to use react-ssr as a sub app in a larger web application. Currently, there is an assumption that react-ssr is configure for the root path of a website.
What I am attempting to do:
From what I can tell, there are three issues to overcome for this to be possible:
Only the first item is required for running in production and this can be achieved by providing a redirect on the server. I made a gist as an example.
If I could provide custom options to
http-proxy-middleware
, this would let me have a development environment for my app. I would use the custom config to provide apathRewrite
option.What do you think? I'll raise a PR so you can see.