How do I create a subdomain in React?

Viewed 366

I'm creating a website that will consist of two parts, one for customers and one for companies. I would like to give the company part its own subdomain, more presicley I want to give them a dashboard under dashboard.myapp.com like Stripe or Fauna. How would I go about doing this?

Should I split the app in two and have one for the dashboard.myapp.com domain and one for the www.myapp.com domain, or would it be sufficient to have them both in the same app and just check when a user is on the subdomain like in this answer?

1 Answers

subdomains aren't created within react. You would need to create it with your Domain name registrar. You can then use react to route people to each domain after creation.

Related