Badrush
Badrush

Reputation: 1287

Deploying Create-React-App to Multiple URLs

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?

Upvotes: 2

Views: 475

Answers (1)

Ioannis Papadopoulos
Ioannis Papadopoulos

Reputation: 135

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

Upvotes: 1

Related Questions