专注、交流、分享
云计算领域最新资讯

简单的零配置命令行HTTP服务器

HTTP -server是基于nodeJs的一个简单零配置命令行HTTP服务器。

nodeJs 的 web-server.Js:

安装 (全局安装加 -g) :

npm install http-server

Windows 下使用:
在站点目录下开启命令行输入

http-server

[laughter] http://localhost:8080 or http://127.0.0.1:8080

和package.json一起使用

“scripts“: {
“start“: “http-server -a 0.0.0.0 -p 8000“,
}

参考:

-p 端口号 (默认 8080)
-IP地址(默认为0.0.0.0)
-d显示列表(默认状态为“True”)
-i显示自动索引(默认状态为“true”)
- e 或 -- ext,如果没有提供默认的文件扩展名(默认的‘ html’)
-s or --silent 禁止使用日志管理信息进行输出
-- Cors something cors allows the origin to nod through access control
-o 在开始服务后打开浏览器
-C set the cache time (seconds) for the cache control maximum age header, eG. -c10 10 seconds (default: 3600).如果已禁用缓存,-C-1
- U something -- UTC something UTC something something something something something log something P or -- proxy all requests that can not be resolved locally to the given url.e[UNK] g. [UNK]-P http://someurl.Com-s or -- ssl something https-c or -- Cert ssl cert something (default: Cert) .PEM) - K or -- SSL key file key path (default: key).Pem).-r or -- robots provides a /robots.Txt (its content defaults to "user agent: * \ n default: /") - H or -- help print the above list and exit
以上就是关于“如何使用Ubuntu 配置webdav服务器”的相关解答,若有不清楚的可以咨询酷番云酷番云作为云南为数不错持有ICP/ISP/IDC等资质专业云计算提供商之一,成本控制良好,性价比高!提供各类云服务器产品及ICP备案一站式服务,操作简单快捷,7*24小时不间断售后运维技术支持,专业备案团队全力支持。
产品购买地址:https://www.kufanyun.com/server/buy.html
赞(0)
未经允许不得转载:酷番云知识库 » 简单的零配置命令行HTTP服务器
  • 日销500+
    基础型虚拟主机

    共享CPU

    共享内存

    2G空间

    共享带宽

    共享IP

    分布式存储

    适合个人博客、个人站长类网站

    ¥9 原价¥28

  • 日销500+
    超值型云主机CVM

    2核CPU

    2G内存

    180G硬盘

    5M带宽

    独立IP

    分布式存储

    适合企业官网、行业门户类网站

    ¥99 原价¥210

  • 日销500+
    通用型云服务器ECS

    4核CPU

    4G内存

    50G硬盘

    20M带宽

    独立IP

    分布式存储

    适合电商、论坛类网站

    ¥254 原价¥322

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

中国领先的企业级云服务提供商

域名注册云服务器