Live-server Introduction
This is a small development server with a thermal load capabilities. Use it to show you the HTML / JavaScript / CSS, but not for the final deployment site.
Official website address: https://www.npmjs.com/package/live-server
use
Official website describes the different installation methods
Npm Way (npm mounting method)
npm install -g live-server
Manual way
git clone https://github.com/tapio/live-server cd live-server npm install # Local dependencies if you want to hack npm install -g # Install globally
Here the use of global installation
npm install -g live-server
start up
Directly enter the command
live-server
You can configure your own parameters
port = NUMBER - The port to be used, the default values: PORT env var or 8080
Host = ADDRESS - to bind the host address selection, default values: IP env var or 0.0.0.0 ( "any address")
NO-Browser - Disable automatic Web browser to launch
browser = bROWSER - specified using a browser rather than the system defaults
quiet | -q - prohibit recording
verbose | -V - more logging (log all requests to display all of the listeners of IPv4 interfaces, etc.)
Open = pATH - pATH to launch the browser, not the server root
Watch = pATH - path delimited by commas to specifically monitor changes (default: view all of the content)
the ignore = pATH - to ignore the comma-separated path string ([anymatch] (https://github.com/es128/anymatch) -compatible Definition)
ignorePattern = RGXP - regular expressions to ignore files (ie `* \ jade`) (** ** not recommended in favor of` --ignore.. `)
Mount = rOUTE: the pATH - provide a path defined content in line (there may be more given Yi)
middleware the pATH = - export middleware functions to be added .js file path; the path may not be a name may be a reference to the extension` middleware` folder bundled middleware
entry-file = PATH - this file (server-root) in place of the missing file (useful for single-page application)
Spa - a request from / abc convert / # / abc (easy one-page application)
the wait = MILLISECONDS - ( default 100ms) to wait for all the changes, and then reload
http-auth enable expect the PATH of htpasswd file - htpasswd = PATH
CORS - any source to enable CORS (reflecting the request source support ticket requests)
HTTPS = PATH - to HTTPS configuration module path
proxy = rOUTE: URL - rOUTE proxy all requests to the URL
help | -h - display the simple tips and exits
version | -v - displays the version and exit
This specifies the port number 9002
Automatically open after launching the browser interface appears index.html