zoukankan      html  css  js  c++  java
  • web服务器live-server(热更新)的安装及使用

    【前言】

      live-server是可以运行前端静态文件的一个服务器,既然我们要前后端分离,所以就需要单独将html代码运行起来,这里我们选择live-server,等到后边真正部署的时候在用nginx

      在写一下简单的项目或学习一些技术的练习,没有服务器的话,每次写的代码都需要手动刷新浏览器。有点无奈,但是如果你安装了这个live-server 服务器就可以不用手动刷新,实时预览自己写的代码了。live-server是一个具有实时重载功能的小型开发服务器。用它来热加载HTML / JavaScript / CSS文件,但不能用于部署最终的网站系统。

    【主体】

     

     

     

     

    --port=NUMBER - select port to use, default: PORT env var or 8080  
    --host=ADDRESS - select host address to bind to, default: IP env var or 0.0.0.0 (“any address”)  
    --no-browser - suppress automatic web browser launching  
    --browser=BROWSER - specify browser to use instead of system default  
    --quiet | -q - suppress logging  
    --verbose | -V - more logging (logs all requests, shows all listening IPv4 interfaces, etc.)  
    --open=PATH - launch browser to PATH instead of server root  
    --watch=PATH - comma-separated string of paths to exclusively watch for changes (default: watch everything)  
    --ignore=PATH - comma-separated string of paths to ignore (anymatch-compatible definition)  
    --ignorePattern=RGXP - Regular expression of files to ignore (ie .*.jade) (DEPRECATED in favor of --ignore)  
    --middleware=PATH - path to .js file exporting a middleware function to add; can be a name without path nor extension to reference bundled middlewares in middleware folder  
    --entry-file=PATH - serve this file (server root relative) in place of missing files (useful for single page apps)  
    --mount=ROUTE:PATH - serve the paths contents under the defined route (multiple definitions possible)  
    --spa - translate requests from /abc to /#/abc (handy for Single Page Apps)  
    --wait=MILLISECONDS - (default 100ms) wait for all changes, before reloading  
    --htpasswd=PATH - Enables http-auth expecting htpasswd file located at PATH  
    --cors - Enables CORS for any origin (reflects request origin, requests with credentials are supported)  
    --https=PATH - PATH to a HTTPS configuration module  
    --proxy=ROUTE:URL - proxy all requests for ROUTE to URL  
    --help | -h - display terse usage hint and exit  
    --version | -v - display version and exit  

    package name: (0710) demo
    version: (1.0.0)
    description: live-server的练习
    entry point: (index.js)
    test command:
    git repository:
    keywords:
    author: 猿来独往
    license: (ISC)
    About to write to D:GitHub_RepositoryClone_Filesvue-study0710package.json:
    
    {
      "name": "demo",
      "version": "1.0.0",
      "description": "live-server的练习",
      "main": "index.js",
      "scripts": {
        "test": "echo "Error: no test specified" && exit 1"
      },
      "author": "猿来独往",
      "license": "ISC"
    }
    
    
    Is this OK? (yes)

    .

  • 相关阅读:
    [译文] 实体与值对象到底是不是一回事?
    实现 WebApi 自托管服务宿主于 WinForms 及其交互
    [译文] C# 8 已成旧闻, 向前, 抵达 C# 9!
    [译文] 为什么你在 C# 里总是应该使用 "var" 关键字
    通过设置iis在局域网中访问网页
    windows 10 安装使用kafka
    ASP.NET Core 2.1 中的 HttpClientFactory (Part 4) 整合Polly实现瞬时故障处理
    ASP.NET Core 2.1 中的 HttpClientFactory (Part 3) 使用Handler实现传出请求中间件
    ASP.NET Core 2.1 中的 HttpClientFactory (Part 2) 定义命名化和类型化的客户端
    Asp.net Core 2.0 OpenId Connect Handler缺失Claims?
  • 原文地址:https://www.cnblogs.com/jianxian/p/12396875.html
Copyright © 2011-2022 走看看