cli icon indicating copy to clipboard operation
cli copied to clipboard

Custom hostname as local address

Open hugobqd opened this issue 11 months ago • 3 comments

Describe the feature

It would be usefull to set the hostname in replacement of the default localhost

"scripts": {
  "dev": "nuxt --hostname myhost"
}

Additional information

  • [ ] Would you be willing to help implement this feature?
  • [ ] Could this feature be implemented as a module?

Final checks

hugobqd avatar Mar 19 '24 16:03 hugobqd

Hi, what would this help with?

moshetanzer avatar Mar 20 '24 22:03 moshetanzer

Hi, what would this help with?

We are dealing with multiple Nuxt apps, connecting with each other. Working localy with localhost and arbitrary port number (3000, 3001, 3002) is problematic.

hugobqd avatar Mar 21 '24 09:03 hugobqd

hi @hugobqd,

Nuxt allows you to define host name using the --host or -h flag which you can define as whatever you wish, however you need to make sure to create that host on your computer before? i.e. if you add a host in your host file called myapp1 you could run pnpm dev --host myapp1 when running the app and it will run at that host.

If you share your system could maybe help you create additional hosts 😄

moshetanzer avatar Mar 21 '24 14:03 moshetanzer