0.1.2 • Published 4 years ago

nuxt-multi-tenancy-module v0.1.2

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

Nuxt Multi Tenancy Module

Run multiple web applications in single NuxtJS instance

Introduction

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.

Installation

  1. Add nuxt-multi-tenancy-module to your project
yarn add nuxt-multi-tenancy-module
  1. Add nuxt-multi-tenancy-module to the buildModules section of nuxt.config.js
export default {
  buildModules: [["nuxt-multi-tenancy-module"]],
  multiTenancyModule: {
    tenants: ["apple", "banana"],
    defaultTenant: "home",
  },
};

Options

tenants

  • Type: Array[String]
  • Required

To specify the list of tenants that shoud match to sub-directories in pages/

defaultTenant

  • Type: String

To specify the default tenant when no tenant is matched

License

MIT License