Home > Web Front-end > JS Tutorial > The local IP cannot access the processing method when building the project

The local IP cannot access the processing method when building the project

php中世界最好的语言
Release: 2018-05-10 10:18:07
Original
2687 people have browsed it

This time I will bring you how to deal with the inaccessibility of the local IP when building the project. What are the precautions to solve the problem of inaccessibility of the local IP when building the project? The following is a practical case, let's take a look.

Problem

vue init webpack myproject The project built using localhost or 127.0.0.1 can be accessed normally, but switching to the local ip does not work

Solution

Append the following code to webpack.dev.conf.

js

const HOST = process.env.HOST || '0.0.0.0';
Copy after login

Restart

npm run dev
Copy after login

Just reopen it

Believe it After reading the case in this article, you have mastered the method. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

JS traversal of irregular multi-dimensional array methods summary

Vue implementation of image carousel component tutorial detailed explanation

The above is the detailed content of The local IP cannot access the processing method when building the project. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template