【Web】http-server 使用教程(用于访问静态资源)

文章目录

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

猜你喜欢

转载自blog.csdn.net/qq_45677671/article/details/135018954