Krabs Configuration
As written in the previous section, we can create a file called .krabs.js
(or .krabs.config.js
) inside of the root folder of our project, and krabs will automatically import the configuration from this file.
The configuration file can export one of the following:
Plain object
Function
Async function
so the following configurations are fully supported:
Object configuration
Function configuration
Async function configuration
With the configuration above, we're adding support for two different tenants:
website-1
website-2
we also write down three different domains for each tenant.
As you can see, in a local environment, website-1 will support all the routes matching the /dev.[a-z]*.local.website-1.com/
regular expression.
That means that we can set up our hosts
file as follows:
and still, be served with the same Next.js website.