https://github.com/ramlmn/serv
💻 A development server for serving static files
https://github.com/ramlmn/serv
cli http http-server http2 https server static tls
Last synced: 11 months ago
JSON representation
💻 A development server for serving static files
- Host: GitHub
- URL: https://github.com/ramlmn/serv
- Owner: ramlmn
- License: mit
- Created: 2017-06-04T13:02:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T16:16:27.000Z (over 5 years ago)
- Last Synced: 2025-03-14T02:49:20.040Z (11 months ago)
- Topics: cli, http, http-server, http2, https, server, static, tls
- Language: JavaScript
- Homepage:
- Size: 346 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/@ramlmn/serv)
[](https://travis-ci.org/ramlmn/serv)
[](https://ci.appveyor.com/project/r0mflip/serv)
# serv
Static file server with https, http2 (recommened only for development)

## Installation
``` bash
$ 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)](https://nodejs.org/api/http2.html#http2_server_side_example)
## License
[MIT](LICENSE)