2

I want to be able to build the same CRA app and deploy it both to www.homepage.com/beta and www.homepage.com/web

The reason is so that I can deploy a different version to my beta users while having a non-beta version of the site up for the other users.

I changed my ROUTEs in React-Router to handle whether a url has /web/ or /beta/ and it was working locally but when I deployed and went to homepage.com/beta my Routes are rendering.

I have narrowed it down to my package.json where it has the homepage property. If it use homepage.com/beta then the beta site works. If I use homepage.com or homepage.com/web/ then the beta stops working properly.

Thoughts?

1 Answer 1

1

I would go for the subdomain solution (beta.homepage.com) which will aditionally allow proper site storage & cookie separation between beta and not beta deployments

Sign up to request clarification or add additional context in comments.

3 Comments

So I would set the homepage property to www.homepage.com in package.json but how would I be able to tell my app which version to load? Would I need to maintain two codebases?
I think that different versions of the application are supposed to be in different codebases (see also docs.npmjs.com/files/package.json#version). The "homepage" property seems to have another purpose (docs.npmjs.com/files/package.json#homepage).
In that case, the routing would be performed via the web server configuration (e.g. for nginx nginx.org/en/docs/http/request_processing.html)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.