2

I'm having a site, let's say example.com which shares the layout and few components with subdomain blog.example.com so i want to create common nuxtJS project for this so that the routes and all things will be optimized by nuxtJS, i don't want to create 2 projects for this as there would be repetition of components, how can i achieve this result?

2
  • The way you are planning to host is important here. Are you planning on using something like Netlify for static-site generation or something like Heroku for server-side-rendering? Commented Aug 18, 2020 at 8:48
  • 1
    actually I'm hosting on vercel with server-side rendering and I've already configured my domain for wild cards so whatever be the subdomain, it is going to load my site Commented Aug 18, 2020 at 10:05

1 Answer 1

2

I achieved the result by filtering the routes to remove and then removing the folder name the path and route name, with @nuxtjs/router module, and for simplicity I've created my own module to do the exact same with user friendly interface, have a look at k-domains npm module. Here's the link to the articlehandle multiple subdomains in nuxtJS project

Sign up to request clarification or add additional context in comments.

2 Comments

is this lib solve wildcard *.abc.com domains?
please update your answar with wildcard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.