Nuxt module to support multi tenancy by subfolder of pages/
npm install nuxt-multi-tenancy-module> Run multiple web applications in single NuxtJS instance
The module creates Vue routes based on the tenant name which can be specifiy by hostname or HTTP header, the tenant name has to match with sub-directory in pages/.
For example, we have tenant apple and create your Vue file tree in pages/apple. When visiting apple tenant, this module will automatically get the corresponding routes of apple.
1. Add nuxt-multi-tenancy-module to your project
``bash`
yarn add nuxt-multi-tenancy-module
2. Add nuxt-multi-tenancy-module to the buildModules section of nuxt.config.js
`js`
export default {
buildModules: [["nuxt-multi-tenancy-module"]],
multiTenancyModule: {
tenants: ["apple", "banana"],
defaultTenant: "home",
},
};
- Type: Array[String]
- Required
To specify the list of tenants that shoud match to sub-directories in pages/
- Type: String`
To specify the default tenant when no tenant is matched
MIT License