Giter Club home page Giter Club logo

Comments (7)

acidjazz avatar acidjazz commented on June 12, 2024 3

Came here looking to have *.domain.com go to something like /pages/_subdomain.vue - is this at all possible?

from k-domains.

ErickPetru avatar ErickPetru commented on June 12, 2024 2

Hi @madhusudanbabar, thanks for your reply. I think we're almost on it but not yet.

The deal is that I don't want a "store" route. The desired URLs would be:

  • bestshoes.myplatform.com (index of the bestshoes e-commerce).
  • bestshoes.myplatform.com/cart (cart of bestshoes e-commerce).
  • foodsite.myplatform.com (index of the foodsite e-commerce).
  • foodsite.myplatform.com/cart (cart of foodsite e-commerce).
  • And so on... These are just samples, all other routes (like product routes) should be available for both subdomains.

I understand that I could put all those routes directly on pages folder and all would be available for every subdomain. But I can't do that, because the www.myplatform.com is the landing page of the platform and were the users create their own subdomains and configure it, so there would be files for the platform itself, not for each store. Can I have all store files mapped to each subdomain but not as a route of the subdomain?

Also, there are another deal: the names and the number of subdomains is unknow. A new user could arrive at the platform landing page and create a new account, registering a custom subdomain for their needs. So, is it possible to update on-the-fly the subDomains property on nuxt.config.js?

from k-domains.

madhusudanbabar avatar madhusudanbabar commented on June 12, 2024

From my understanding,
I guess you want to have shared folders across multiples subdomains?

let's say you have 2 subdomains bestshoes and foodsite
so your config file looks like this:

  export default {
    buildModules: [
      [ "k-domains", {
          subDomains: ["bestshoes", "foodsite" ],
          rootDomain: "root-domain" 
      }]
    ]
}

but even in this case, if you create a folder at pages and without adding it to the subdomains option in nuxt.config, it will be automatically mapped to all the subdomains.

consider this is your pages tree

|   
|─pages
|   ├───bestshoes
|   ├───foodsite
|   ├───root-domain
|   └───store // not added in the config file
|         ├───index.vue
|         └───offer.vue

so even in this version, the shared will be accessible from all the domains
all the following will work:

  • bestshoes.myplatform.com/store
  • bestshoes.myplatform.com/store/offer
  • foodsite.myplatform.com/store
  • foodsite.myplatform.com/store/offer

and for getting the current subdomain, so yes I will add it in future releases, I'll export a variable for the current subdomain.

from k-domains.

madhusudanbabar avatar madhusudanbabar commented on June 12, 2024

sorry for the late reply,
yes, I got it now, so in short, we've to map some folders to only selected subdomains with or w/o changing the route path, I mean including the store in the path or omitting it, both things are possible, I'll give it a try very soon, thanks

from k-domains.

feikeq avatar feikeq commented on June 12, 2024

是的,我也想要通过 * 泛域名指向pages里不同的文件夹

from k-domains.

binumathew avatar binumathew commented on June 12, 2024

I also have the same problem, its like a blog site, where my clients can choose different subdomain they want. can we use this module in that purpose? or only have static use case?

from k-domains.

Kameecoding avatar Kameecoding commented on June 12, 2024

@madhusudanbabar was the variable for exposing current subdomain ever added?

from k-domains.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.