I want to let users sign-up for a sub-domain on my app's main domain. Unfortunately Firebase Hosting doesn't support wildcard subdomains (yet?), but I think I have an almost-automated way to do this.
I'll lay out my plan, but I'd really appreciate any feedback or improvements of how else I should solve this problem.
Steps:
- Gather a user's intention to create a subdomain
- Automate Firebase CLI to create another site, get DNS settings and add them into a Firestore doc (that I will then show the user)
- Upload a simple HTML page with
<object>
and their siteapp.website/username
- Cry because
<objects>
doesn't change the URL in the browser
Each user has a public profile on the main domain, like this: app.website/username
, but I want to also host this page at username.app.website
so they can point their domain (or subdomain) to their app.
Is there a way to do this efficiently?