Skip to content
Branch: master
Find file History
Permalink
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
readme.md chore(sirv-cli): include `--dev` flag in readme (#28) May 12, 2019

readme.md

sirv-cli

sirv-cli

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.

Install

$ npm install --save sirv-cli

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

Usage

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

  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
    -p, --port         Port to listen  (default 5000)
    -h, --help         Displays this message

License

MIT © Luke Edwards

You can’t perform that action at this time.