Allow for deployment in subdirectory
See original GitHub issueIs your feature request related to a problem? Please describe.
Currently the app assumes to be deployed on a separate (sub)domain. For the BTCPay Server integration I’d like to use our existing FE proxy (nginx) and certificates to provide an easier setup for the user. I imaging deploying the LiT app in a subdirectory of the existing BTCPay domain, like mybtcpay.com/lit/
.
Right now the asset and API requests target the root /
, whereas we would need to have them prefixed with /lit/
.
Describe the solution you’d like
I started looking into this a bit and found the option of setting the homepage
option for create-react-app. By using "homepage": "."
as a setting the build uses a relative URL for the asset references, which would solve that part. I’m unsure though whether or not this also works for the API calls. Before proceeding on that front I wanted to inquire if this feature would be wanted.
Describe alternatives you’ve considered
I’ve started using nginx sub_filter
directives in our setup to rewrite certain URLs, but this is error prone and brittle.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (14 by maintainers)
Top GitHub Comments
I believe that setting
PUBLIC_URL
would help solve both of these issues, but you’d also need a code change for the second one. The magic-string paths specified in the Routes.tsx and appView.ts would also need to be updated to include thePUBLIC_URL
env value. I haven’t tested myself but this seems doable.No, that’s what the map at the beginning is for. Only LiT makes calls with
Content-Type: application/grpc-web+proto
while any other, normal, gRPC traffic will haveContent-Type: application/grpc
. So the requests will be forwarded either to LiT or tolnd
depending on whether they come from LiT or not.gRPC doesn’t support relative paths for RPC requests. So this might not even be possible with the library we use.