Skip to content
/ serv Public

πŸ’» A development server for serving static files

License

Notifications You must be signed in to change notification settings

ramlmn/serv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9077835 Β· Oct 13, 2020

History

56 Commits
Oct 13, 2020
May 22, 2019
Feb 10, 2019
May 19, 2019
May 19, 2019
Feb 8, 2019
Jul 24, 2018
May 19, 2019
Feb 15, 2018
May 19, 2019
Mar 22, 2020
May 22, 2019

Repository files navigation

npm-badge travis-badge appveyor-badge

serv

Static file server with https, http2 (recommened only for development)

terminal.png

Installation

$ npm install --global @ramlmn/serv

Usage

  serv - Static file server with https and http2

  Usage
    Serve current directory

      $ serv

    Listen on port 8080 with compression

      $ serv --port 8080 --compress -d ./site/

    Listen over https with directory listing (uses self-signed certificates)

      $ serv --self-signed --listing

    Use specific SSL certificate and private key

      $ serv --ssl-cert ./cred.cert --ssl-key ./cred.key

  Options
    -h, --help             Shows this help text
    -p, --port             Port to listen on (default $PORT or 5000)
    -d, --dir              Path to directory
    -l, --listing          Enable directory listing
    -c, --compress         Enables compression (gzip)
    -s, --ssl              Use self-signed certificates (enables TLS/SSL)
    --ssl-cert             Path to SSL certificate file (enables TLS/SSL)
    --ssl-key              Path to SSL private key file (enables TLS/SSL)
    --http2                Use http2 (enables TLS/SSL)

Note: Currently no browser supports http2 without TLS, --http2 currently is worthy only when TLS/SSL is enabled (ref)

License

MIT