sirv-cli

A lightweight CLI program to serve static sites~!

sirv-cli
A lightweight CLI program to serve static sites~!

Quickly start a server to preview the assets of anydirectory!

Just like serve, you may install and use sirv-cliglobally or on a per-project basis.

Install

$ npm install --save sirv-cli

Note:This module can also be installed and used globally~!

Usage

Running sirvas a standalone command is an alias of sirv start, with the sole exception of displaying help text!

Note:This is because sirv-climay include new commands in the future.
For example, compression may be extracted to a compresscommand, or watchmay be added.

$ sirv --help

  Usage
    $ sirv <command> [options]

  Available Commands
    start    Start a static file server.

  For more info, run any command with the `--help` flag
    $ sirv start --help

  Options
    -v, --version    Displays current version
    -h, --help       Displays this message

  Examples
    $ sirv build --cors --port 8080
    $ sirv start build --cors --port 8080
    $ sirv public --quiet --etag --maxage 31536000 --immutable
    $ sirv start public -qeim 31536000
    $ sirv --port 8080 --etag
$ sirv start --help

  Description
    Start a static file server.

  Usage
    $ sirv start [dir] [options]

  Options
    -D, --dev          Enable "dev" mode
    -e, --etag         Enable "Etag" header
    -d, --dotfiles     Enable dotfile asset requests
    -c, --cors         Enable "CORS" headers to allow any origin requestor
    -m, --maxage       Enable "Cache-Control" header & define its "max-age" value (sec)
    -i, --immutable    Enable the "immutable" directive for "Cache-Control" header
    -s, --single       Serve single-page applications
    -q, --quiet        Disable logging to terminal
    -H, --host         Hostname to bind  (default localhost)
    -p, --port         Port to bind  (default 5000)
    -h, --help         Displays this message

Note:The HOSTand PORTenvironment variables will override flag values.

License

MIT © Luke Edwards

Repository

lukeed/sirv


上一篇:svelte
下一篇:gantt-schedule-timeline-calendar

相关推荐

官方社区

扫码加入 JavaScript 社区