DEV Community

Krypton | Madhusudan Babar
Krypton | Madhusudan Babar

Posted on

1

Handling subdomains with js frameworks

Is it possible to handle subdomains with frameworks?

Here I'm talking about nuxtJS specifically,
I'm having a site, let's say example.com which shares the layout and few components with subdomain blog.example.com, now i want to create common nuxtJS project for this so that the layouts and other things can be shared between them. I already tried to implement it but I'm not getting the expected result...
Let's say I'm having folder structure like:

Pages / main-domain 
     |__subdomain
Enter fullscreen mode Exit fullscreen mode

As we can get subdomain part from window.location,so modifying default routes i can serve the files based on the url, and even my DNS is also configured for wildcard card locations so i can go to *.example.com and it'll show me my site but now problem is that I don't know how can i travel between different subdomains.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay