npm i -g node-static
static --help
USAGE: /Users/svpg/.config/yarn/global/node_modules/.bin/static [-p <port>] [<directory>]
simple, rfc 2616 compliant file streaming module for node
Options:
--port, -p TCP port at which the files will be served [default: 8080]
--host-address, -a the local network interface at which to listen [default: "127.0.0.1"]
--cache, -c "Cache-Control" header setting, defaults to 3600
--version, -v node-static version
--headers, -H additional headers (in JSON format)
--header-file, -f JSON file of additional headers
--gzip, -z enable compression (tries to serve file of same name plus '.gz')
--spa serve the content as a single page app by redirecting all non-file requests to the index html file
--indexFile, -i specify a custom index file when serving up directories [default: "index.html"]
--help, -h display this help message
node-static
使用: