I cannot access my Vue CLI project via IP

Asked

Viewed 547 times

1

I start my Vue CLI (webpack template) project from the terminal with npm run dev and initializes everything normal. I can access my web project from localhost or 127.0.0.1, but when I try to access by the ip of my machine I can not, either by pc or by mobile.
Remarks:

  • My ip is right because I picked up by ifconfig;
  • I can ping my ip;
  • The door is also right, because I can access through localhost:8080;
  • Linux Ubuntu 18.04
  • The network is with internet;


Cell phone and notebook error:
Unable to access this site
Connection with 10.0.0.107 was refused.
Erro do navegador do notebook Retorno ifconfig e servidor rodando na porta 8080

  • [SOLVED] In the project Vuecli has a configuration file in config/index.js in which it has an attribute set as localhost which is the attribute host ('module.Exports'.dev.host). So you can change the value of this attribute to your local IP and access it via your IP (e.g., host: 'localhost' -> host: '192.168.0.85'). The problem with this solution is that you can no longer access through localhost.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.