0.1.0 • Published 5 years ago

@careteen/http-server v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

http-server

npm.io license Build Status npm NPM downloads

学习并仿写http-server,目前已提供基础功能。

  • 支持命令行帮助
  • 实现缓存
  • 实现压缩
  • 丰富文件夹显示页面
  • 美化404页面

快速使用

全局安装

npm i -g @careteen/http-server

在需要启动服务的地方执行下面命令

@careteen-http-server
# or 简写
@careteen-hs

默认端口是8080

查看命令帮助

@careteen-hs --help

指定端口访问

@careteen-hs --port 3000
# or
@careteen-hs -p 3000

指定主机

@careteen-hs --address 127.0.0.1
# or
@careteen-hs -a 127.0.0.1

指定特定文件夹启动服务

@careteen-hs --dir /tmp
# or
@careteen-hs -d tmp

使用文档