zoukankan      html  css  js  c++  java
  • npm serve md 工具 [MD]

    博文地址

    我的GitHub 我的博客 我的微信 我的邮箱
    baiqiantao baiqiantao bqt20094 baiqiantao@sina.com

    目录

    常用的几个 npm 工具

    npm serve

    Static file serving and directory listing.

    serve a static site, a single page application, a static file, no matter if on your device or on the local network

    基本使用

    最简单的使用方式:在当前目录下执行命令npx serve即可。

    yarn global add serve  # 全局安装 serve
    serve -v               # 查看版本
    serve --help           # 查看帮助文件
    
    serve                  # 在当前目录下启动服务,启动后会自动将地址拷贝到粘贴板
    serve -p 10086         # 在当前目录下启动服务,并指定端口【http://localhost:10086】
    serve folder_name      # 在指定的目录下启动服务
    

    By default, serve will listen on 0.0.0.0:3000 and serve the current working directory on that address.

    支持的参数

    常用

    • -l, listen:Specify a URI endpoint 端点 on which to listen, more than one may be specified to listen in multiple places
    • -p, port:Specify custom port 端口
    • -d, debug:Show debugging information
    • -s, single:Rewrite all not-found requests to index.html

    不常用

    • -c, config:Specify custom path to serve.json
    • -C, cors:Enable CORS, sets Access-Control-Allow-Origin to *
    • -n, no-clipboard:Do not copy the local address to the clipboard
    • -u, no-compression:Do not compress files
    • -S, symlinks:Resolve symlinks instead of showing 404 errors
    • --no-etag:Send Last-Modified header instead of ETag
    • --ssl-cert:Optional path to an SSL/TLS certificate to serve with HTTPS
    • --ssl-key:Optional path to the SSL/TLS certificate's private key 私钥
    • --ssl-pass:Optional path to the SSL/TLS certificate's passphrase 密钥
    • --no-port-switching:Do not open a port other than 除了 the one specified when it's taken.

    监听端口

    Listen endpoints (specified by the --listen or -l options above) instruct 指示 serve to listen on one or more interfaces/ports, UNIX domain sockets, or Windows named pipes.

    • For TCP ports on hostname "localhost":serve -l 1234
    • For TCP (traditional host/port) endpoints:serve -l tcp://hostname:1234
    • For UNIX domain socket endpoints:serve -l unix:/path/to/socket.sock
    • For Windows named pipe endpoints:serve -l pipe:\\.\pipe\PipeName

    npm md

    一款高度简洁的微信 Markdown 编辑器:支持 Markdown 所有基础语法、色盘取色、一键复制并粘贴到公众号后台、多图上传、一键下载文档、自定义 CSS 样式、一键重置等特性

    开发和部署

    npm i               # 安装依赖
    npm run serve       # 启动开发模式
    npm run build       # 输出部署版本
    

    2017-01-16

  • 相关阅读:
    亚信防毒墙网络版卸载
    Ubuntu之apt
    Python(00):内存中读写数据StringIO和BytesIO
    Windows使用cmd命令行中查看、修改、删除与添加环境变量
    微信小程序教程
    微信小程序之云开发
    微信小程序-简易计算器
    第一个微信小程序——实现获取用户信息替换用户名和头像到首页
    Python(00):RSA加解密
    Python(00):使用selenium模块
  • 原文地址:https://www.cnblogs.com/baiqiantao/p/6290306.html
Copyright © 2011-2022 走看看