@masx200/serve-cli
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

serve-cli

Description

A simple zero-configuration command-line static file server based on koa2.

支持范围请求,条件请求,内容压缩,跨域访问,添加 etag 头部

Installation

Globally via yarn

yarn global add @masx200/serve-cli

Running on-demand:

npx @masx200/serve-cli [options]

Examples

npx @masx200/serve-cli --help
serve-cli
usage: serve-cli [options]

options:
  --path,-pa       Path to folder [process.cwd()]
  --host,-h       Host to use [0.0.0.0]
  --port,-po       Port to use [4000]
  --ssl,-s        Enable https [false]
  --sslKey     Path to ssl key file [self-signed]
  --sslCert    Path to ssl cert file [self-signed]
  --help,-h       Print this list and exit

TLS/SSL

First, you need to make sure that openssl is installed correctly, and you have key.pem and cert.pem files.

Then you need to run the server with --ssl for enabling SSL and --sslKey=key.pem --sslCert=cert.pem for your certificate files.

Readme

Keywords

none

Package Sidebar

Install

npm i @masx200/serve-cli

Weekly Downloads

4

Version

1.3.1

License

MIT

Unpacked Size

2.22 MB

Total Files

72

Last publish

Collaborators

  • masx200