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