Automatically refresh pages with Node-livereload

Source: Internet
Author: User

1. Install node

2. Install Python

3. Install Connect, serve-static and node-livereload (assuming the command line current directory is e:\WebSite)

E:\WEBSITE>NPM Install Connect

E:\WEBSITE>NPM Install Serve-static

E:\WEBSITE>NPM Install Livereload

If you see an error similar to themsb8036:the Windows SDK version 8.1 is not found, use the Visual Studio installation package to install "Tools and Windows SDKs"

4. Install the Google Chrom plugin livereload

Https://chrome.google.com/webstore/detail/jnihajbhpnppcggbcgedagnkighmdlei

5. Create the Web server and file watch server, save the script as E:\WebSite\server.js

var connect = require (' Connect '); var servestatic = require (' serve-static '); var app =+ "\\WebSite"); App.listen; Console.log (' Web Server start ' ); = require (' livereload '=+ "\\WebSite"); Console.log (' File watching start ')

6. Running Server.js

E:\website>node Server.js

So as long as the file under the E:\WebSite update, the browser opens the page will automatically refresh

Automatically refresh pages with Node-livereload

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.