https://github.com/janiltonmaciel/statiks
Fast, zero-configuration, static HTTP filer server.
https://github.com/janiltonmaciel/statiks
cli file-server golang server static-server
Last synced: 3 months ago
JSON representation
Fast, zero-configuration, static HTTP filer server.
- Host: GitHub
- URL: https://github.com/janiltonmaciel/statiks
- Owner: janiltonmaciel
- License: mit
- Created: 2018-06-26T23:42:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-16T23:39:49.000Z (7 months ago)
- Last Synced: 2025-05-11T22:38:49.219Z (7 months ago)
- Topics: cli, file-server, golang, server, static-server
- Language: Go
- Homepage:
- Size: 185 KB
- Stars: 11
- Watchers: 0
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - statiks - Fast, zero-configuration, static HTTP filer server. (Utilities / Utility/Miscellaneous)
- awesome-go-cn - statiks
- awesome-go-plus - statiks - Fast, zero-configuration, static HTTP filer server.  (Utilities / Utility/Miscellaneous)
- awesome-go - statiks - Fast, zero-configuration, static HTTP filer server. (Utilities / Utility/Miscellaneous)
- awesome-go - statiks - Fast, zero-configuration, static HTTP filer server. (Utilities / Utility/Miscellaneous)
- fucking-awesome-go - statiks - Fast, zero-configuration, static HTTP filer server. (Utilities / Utility/Miscellaneous)
- awesome-go-cn - statiks
- awesome-go-extra - statiks - configuration, static HTTP filer server.|9|1|0|2018-06-26T23:42:33Z|2020-10-06T20:27:09Z| (Utilities / Fail injection)
- awesome-go - statiks - Fast, zero-configuration, static HTTP filer server. (Utilities / Utility/Miscellaneous)
- awesome-go-with-stars - statiks - Fast, zero-configuration, static HTTP filer server. (Utilities / Utility/Miscellaneous)
- awesome-go - statiks - Fast, zero-configuration, static HTTP filer server. (Utilities / Utility/Miscellaneous)
- awesome-go-cn - statiks
README
# Statiks
Fast, zero-configuration, static HTTP filer server.
Like Python's `SimpleHTTPServer` but scalable.
[](https://github.com/janiltonmaciel/statiks/releases)
[](https://pkg.go.dev/github.com/janiltonmaciel/statiks?tab=overview)
[](https://goreportcard.com/report/github.com/janiltonmaciel/statiks)
[](https://travis-ci.org/janiltonmaciel/statiks)
[](https://codecov.io/gh/janiltonmaciel/statiks)
[](https://github.com/avelino/awesome-go)
## Features
* HTTP and HTTPS (TLS/SSL)
* Support directory list
* Cache control and "Last-Modified"
* Delay response
* CORS support
* Content compression (gzip)
* Request logging
## Installation
#### Via Binaries
- **darwin (macOS)** [amd64](https://github.com/janiltonmaciel/statiks/releases/download/v1.7.0/statiks_v1.7.0_darwin_amd64.tar.gz)
- **linux** [amd64](https://github.com/janiltonmaciel/statiks/releases/download/v1.7.0/statiks_v1.7.0_linux_amd64.tar.gz)
- **windows** [amd64](https://github.com/janiltonmaciel/statiks/releases/download/v1.7.0/statiks_v1.7.0_windows_amd64.zip)
#### Via Homebrew (macOS)
```bash
brew tap janiltonmaciel/homebrew-tap
brew install statiks
```
#### Via Docker
The official [janilton/statiks](https://hub.docker.com/r/janilton/statiks) image is available on Docker Hub.
```bash
docker container run -p 9080:9080 -v .:/var/www --rm janilton/statiks
```
> Volume dir: /var/www
> Expose port: 9080
## Use
```bash
statiks [options]
OPTIONS:
--host value, -h value host address to bind to (default: "0.0.0.0") [$HOST]
--port value, -p value port number (default: "9080") [$PORT]
--quiet, -q enable quiet mode, do not output each incoming request (default: false)
--add-delay value add delay to responses (in milliseconds) (default: 0)
--cache value set cache time (in seconds) for cache-control max-age header (default: 0)
--no-index disable directory listings (default: false)
--compression enable gzip compression (default: false)
--include-hidden enable hidden files as normal (default: false)
--cors enable CORS allowing all origins with all standard methods with any header and credentials. (default: false)
--ssl enable https (default: false)
--cert value path to the ssl cert file (default: "cert.pem")
--key value path to the ssl key file (default: "key.pem")
--help show help (default: false)
--version, -v print the version (default: false)
```
> `` defaults to `.` (relative path to the current directory)
## Examples
* start server at http://0.0.0.0:9000 serving "." current directory
```bash
statiks -port 9000
```
* start server at http://0.0.0.0:9080 serving "/home" with CORS
```bash
statiks --cors /home
```
* start server at http://192.168.1.100:9080 serving "/tmp" with gzip compression
```bash
statiks --host 192.168.1.100 --compression /tmp
```
* start server at https://0.0.0.0:9080 serving "." with HTTPS
```bash
statiks --ssl --cert cert.pem --key key.pem
```
* start server at http://0.0.0.0:9080 serving "/tmp" with delay response 100ms
```bash
statiks --add-delay 100 /tmp
```
## Credits
* Check - [go-check/check](https://github.com/go-check/check) (testing)
* Cli - [urfave/cli](https://github.com/urfave/cli)
* Cors - [rs/cors](https://github.com/rs/cors)
* Httpexpect - [gavv/httpexpect](https://github.com/gavv/httpexpect) (testing)
* Negroni - [urfave/negroni](https://github.com/urfave/negroni)