文章目录
http-server:主要用于访问项目下的静态资源,比如
index.html
文件等
- 安装指令:
npm i -g http-server
- 运行指令:
http-server
- 示例:
➜ porject git:(test) http-server
Starting up http-server, serving ./public
http-server version: 14.1.1
http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none
Available on:
http://127.0.0.1:8080
http://9.135.9.87:8080
Hit CTRL-C to stop the server
- 点击
Available on
下的其中一个地址打开即可
1. http://127.0.0.1:8080
2. http://9.135.9.87:8080
- 官方文档:前往查看