Static web development artifact live-server

"  As a back-end developer, when the front and back ends are separated, native development can use it. "

    live-server: A small server with real-time loading function, which can be used to crack html/css/javascript, but cannot be used to deploy the final site. That is to say, we can use live-server as a real-time server to view the developed webpage or project effect in real time in the project. [The explanation given by the blog garden does not specifically explain it on the official website]

quick loading

        You need to check whether the computer has installed node.js, if yes, go on to the next one, if not, go to the next one, the official website is very fast. (Some online articles give installation first, the version control tool nvm of node.js, and then install the latest node.js through nvm, I think it is unnecessary, and the installation is very slow, just one step in place)

        The download of node.js is relatively simple. The official website: http://nodejs.cn/ downloads quickly and then installs it. It is also very fast. You can directly download the stable version displayed on the official website.

live-server is an npm tool, installation command:

npm install -g live-server

    There may be a phenomenon that the installation is extremely slow. It may be that a foreign mirror is used. Try changing the mirror to a domestic one, such as Ali’s Taobao mirror.

# 查看镜像源npm config get registry# 切换镜像源为淘宝的镜像源npm config set registry https://registry.npm.taobao.org

access

Check if the installation was successful:

    Then use CMD to enter the command line window, enter the directory of static files, enter the script live-server and it will automatically jump to http://127.0.0.1:8080 for access (after closing the terminal, it will automatically be unable to access).

# 启动脚本命令live-server

 

Guess you like

Origin blog.csdn.net/lxd_max/article/details/127834716