zoukankan      html  css  js  c++  java
  • 简易web服务器(npm)

    npm install -g http-server 以后可以在任何一个文件夹启动静态文件的访问通过
    http-server -a localhost -p 8000
    ctrl + c结束

    http-server -h

    npm 仓库地址: https://www.npmjs.com/package/http-server

    git-hub: https://github.com/indexzero/http-server

    -p 端口号 (默认 8080)
    
    -a IP 地址 (默认 0.0.0.0)
    
    -d 显示目录列表 (默认 'True')
    
    -i 显示 autoIndex (默认 'True')
    
    -e or --ext 如果没有提供默认的文件扩展名(默认 'html')
    
    -s or --silent 禁止日志信息输出
    
    --cors 启用 CORS via the Access-Control-Allow-Origin header
    
    -o 在开始服务后打开浏览器
    
    -h or --help 打印列表并退出
    
    -c 为 cache-control max-age header 设置Cache time(秒) , e.g. -c10 for 10 seconds (defaults to '3600'). 禁用 caching, 则使用 -c-1.

    http://www.cnblogs.com/lucker/p/4108838.html

    三种方式实现http-server
    http://blog.163.com/web_promise/blog/static/1096316552011224101531794/

  • 相关阅读:
    listview 优化
    重要博客网址
    bottombar——Fragment
    视频播放,,今日头条样式
    databinding
    Picasso
    22222222
    202004leetcode刷题记录
    批量下载邮箱中指定日期范围的附件
    有雾环境下的目标检测
  • 原文地址:https://www.cnblogs.com/isdom/p/webclips050.html
Copyright © 2011-2022 走看看