当前位置:首页 > 技术教程 > 正文

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

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

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

nodeJs 的 web-server.Js:

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

Windows 下使用:

在站点目录下开启命令行输入

http-server

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

和package.json一起使用

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

“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

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

0