Comments (7)
Came here looking to have *.domain.com go to something like /pages/_subdomain.vue
- is this at all possible?
from k-domains.
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.
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.
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.
是的,我也想要通过 * 泛域名指向pages里不同的文件夹
from k-domains.
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.
@madhusudanbabar was the variable for exposing current subdomain ever added?
from k-domains.
Related Issues (13)
- Use extendRoutes in module directly
- Subdomain still access main domain HOT 2
- SPA on sub-domain and Static site on root-domain? HOT 1
- Doesn't seem to work for me HOT 4
- go to subdomain nuxt-link HOT 1
- Can't resolve 'child_process' 'fs' 'module' HOT 3
- Cannot read property 'substr' of undefined HOT 1
- Nuxt-18n support? HOT 2
- Allow change to default "subdomain not found" behaviour
- Disable redirect to rootdomain if subdomain does not exist
- Can't reexport the named export 'XXX' from non EcmaScript module
- How can we use with nuxt 3 js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k-domains.