There is also a middleware for this for inspiration or usage:
From a UI perspective I think with a new field in the route where you can enter the subdomain if any would be enough. And when viewing the list of routes a tag next to the route with the subdomain string.
Use cases(among others):
Separate Marketing site from Webapp site ( www.website.com and app.website.com)
Different entry points depending on type of users (user.website.com and client.website.com)
I gave it a few tries with the middleware and was able to handle simple redirects and static when requests came from the subdomain while forwarding everything to Wappler’s router when not from the subdomain. That was pretty easy.
A completely different topic was when trying to deal with SC and templateView routes from the subdomain. It was a nightmare of never ending loops
Thanks @patrick! That was easy. I was overcomplicating everything.
I need to to do a few adjustments for my static assets(JS,CSS and translation files) that are loaded from routes.route.data info but this points me in the right direction.