Skip to content
Branch: master
Find file History
Type Name Latest commit message Commit time
Failed to load latest commit information.
boot.js feat: pass `req, res` to `opts.onNoMatch` handler Apr 23, 2019
index.js cli: add `--dev` example Aug 20, 2018
package.json v0.4.2 May 9, 2019 chore(sirv-cli): include `--dev` flag in readme (#28) May 12, 2019



A lightweight CLI program to serve static sites~!

Quickly start a server to preview the assets of any directory!

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


$ npm install --save sirv-cli

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


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

Note: This is because sirv-cli may include new commands in the future.
For example, compression may be extracted to a compress command, or watch may be added.

$ sirv --help

    $ sirv <command> [options]

  Available Commands
    start    Start a static file server.

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

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

    $ 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

    Start a static file server.

    $ sirv start [dir] [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
    -p, --port         Port to listen  (default 5000)
    -h, --help         Displays this message


MIT © Luke Edwards

You can’t perform that action at this time.