https://github.com/albinodrought/creamy-static
Barebones web-accessible file directory
https://github.com/albinodrought/creamy-static
creamy golang static-file-server
Last synced: 11 months ago
JSON representation
Barebones web-accessible file directory
- Host: GitHub
- URL: https://github.com/albinodrought/creamy-static
- Owner: AlbinoDrought
- License: agpl-3.0
- Created: 2019-02-27T03:21:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-11T05:52:01.000Z (almost 6 years ago)
- Last Synced: 2025-03-06T04:17:49.808Z (over 1 year ago)
- Topics: creamy, golang, static-file-server
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Creamy Static
No-fluff [`pkg/net/http` FileServer](https://golang.org/pkg/net/http/#FileServer) wrapper
for serving a local directory on the web
## Usage
- `FILE_PATH`: location to load files from, defaults to `./static` (effectively `/static` in container)
- `PORT`: port to listen on, defaults to `80`
- `WATERMARK`: text to show on HTML pages as a watermark, disabled by default
- `BASIC_AUTH_USERNAME`: enable basic auth with this username
- `BASIC_AUTH_PASSWORD`: enable basic auth with this password
### With Docker
```sh
docker run --rm -it \
-p 80:80 \
-v $(pwd)/foo/bar:/static \
-e WATERMARK="creamy-static was here" \
albinodrought/creamy-static
```
### Without Docker
```sh
FILE_PATH=./foo/bar \
PORT=80 \
WATERMARK="creamy-static was here" \
./creamy-static
```
## Building
### With Docker
```sh
docker build -t albinodrought/creamy-static .
```
### Without Docker
```sh
go get && go build
```