Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Tenant url does not work locally #15

Closed
28development opened this issue Aug 5, 2021 · 2 comments
Closed

Tenant url does not work locally #15

28development opened this issue Aug 5, 2021 · 2 comments

Comments

@28development
Copy link

I set up kraber nextjs with express, my server runs properly. This is my .kraber.js file

module.exports = {
  tenants: [
    {
      name: 'website-1',
      domains: [
        {
          development: /dev\.[a-z]*\.local\.website-1\.com/, // Regex supported!
          staging: 'stage.website-1.com',
          production: 'website-1.com',
        },
      ],
    },
    {
      name: 'website-2',
      domains: [
        {
          development: 'local.website-2.com',
          staging: 'stage.website-2.com',
          production: /[\w|\d|-|_]+\.website-2.com/, // Regex supported!
        },
      ],
    },
  ],
};

Inside pagesI created the folder website-1 and website-2 with a simple index.js page

I can't access the page using following URLs locally:

dev.website-1.com:3000
local.website-1.com:3000

nor

dev.website-2.com:3000
local.website-2.com:3000

What am I missing?

@28development
Copy link
Author

ok after updating my hosts' file on my local dev machine it worked using an URL like this

http://local.website-2.com:3000/about

is this intended behavior, because if I locally create a new tenant I have to edit and update my hosts file again right?

@micheleriva
Copy link
Owner

Hi!
Just make sure that the configuration file is called either .krabs.js or .krabs.config.js!
Also, you have to configure the host file by adding your custom domains.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants