https://github.com/aerth/servest
Small, Simple HTTP Fileserver
https://github.com/aerth/servest
Last synced: 7 days ago
JSON representation
Small, Simple HTTP Fileserver
- Host: GitHub
- URL: https://github.com/aerth/servest
- Owner: aerth
- License: mit
- Created: 2016-03-22T12:26:13.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-07T20:13:19.000Z (almost 4 years ago)
- Last Synced: 2024-08-04T09:01:30.107Z (12 months ago)
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# servest
[](https://github.com/aerth/servest)
[](https://goreportcard.com/report/github.com/aerth/servest)
[](https://pkg.go.dev/github.com/aerth/servest)
[](https://github.com/aerth/servest/blob/master/LICENSE.md)Lightweight and easy-to-configure http fileserver
When Makefile is used, default bind interface is 0.0.0.0
When `go run -v github.com/aerth/servest@latest` is used, default bind interface is 127.0.0.1
Without `-p` flag, `servest` finds an available port from 8000 to 8999, and serves current directory (or `public-html` if it exists)
With `-single` flag, `servest` will serve /index.html, or /{path}/index.html if it path has no extension
See Makefile for build customization, such as default directory and default bind address
```
servest v1.0.1
Source: https://github.com/aerth/servest
Usage: servest [flags]
-d string
Directory to serve (if empty: public-html, or current working dir)
-i string
Interface to listen on, default 0.0.0.0 (default "0.0.0.0")
-log
Enable http request logging
-maxport int
Maximum port to try binding to (default 8999)
-minport int
Minimum port to try binding to (default 8000)
-p int
Port to listen on (default: 0, look for free port)
-single
Single page mode (see below)
-version
Show version information and exitExample:
servest -log -i 127.0.0.1 -p 8080 -d /var/www/html
Run without installing:
go run -v github.com/aerth/servest@latest -d /some/dir
Serve current directory:
servestSingle page mode: will serve index.html for all requests that do not match an existing file. The subdirectory may contain an index.html, and that will be served if nonzero size.
```TODO:
* pidfile option?
* logfile option?
* daemonize option?