https://github.com/hupe1980/fileserve
Golang-based simple file server to serve files of the current working directory
https://github.com/hupe1980/fileserve
cli fileserver golang portable
Last synced: 7 months ago
JSON representation
Golang-based simple file server to serve files of the current working directory
- Host: GitHub
- URL: https://github.com/hupe1980/fileserve
- Owner: hupe1980
- License: mit
- Created: 2021-12-03T14:45:57.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-06T14:07:58.000Z (almost 4 years ago)
- Last Synced: 2025-02-02T02:14:04.686Z (8 months ago)
- Topics: cli, fileserver, golang, portable
- Language: Go
- Homepage:
- Size: 135 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fileserve

[](https://pkg.go.dev/github.com/hupe1980/fileserve)
> Golang-based simple file server to serve static files of the current working directory
- File sharing in LAN or home network
- Web application testing
- Personal web site hosting or demonstrating## Features
- Directory listing
- Filter dot files
- Cors or NoCache headers
- HTTPS with self-signed certificate
- BasicAuth
- Custom HTTP headers## Installing
You can install the pre-compiled binary in several different ways### homebrew tap:
```bash
brew tap hupe1980/fileserve
brew install fileserve
```### snapcraft:
[](https://snapcraft.io/fileserve)
```bash
sudo snap install fileserve
```### scoop:
```bash
scoop bucket add fileserve https://github.com/hupe1980/fileserve-bucket.git
scoop install fileserve
```### deb/rpm/apk:
Download the .deb, .rpm or .apk from the [releases page](https://github.com/hupe1980/fileserve/releases) and install them with the appropriate tools.
### manually:
Download the pre-compiled binaries from the [releases page](https://github.com/hupe1980/fileserve/releases) and copy to the desired location.## How to use
```bash
fileserve is a tiny go based file serverUsage:
fileserve [root] [flags]Examples:
- serve the current working dir: fileserve
- add basic auth: fileserve -a user1:pass1 -a user2:pass2
- add custom http headers: fileserve --header Test=ABC --header Foo=Bar
- disable serving of dot files: fileserve --no-dotFlags:
-a, --auth stringArray turn on basic auth and set username and password (separate by colon)
-b, --bind string bind to a specific interface (default "0.0.0.0")
--cors allow cross origin requests to be served
--header stringToString add custom http headers (default [])
-h, --help help for fileserve
-s, --https serve with a temp self-signed certificate via HTTPS
--no-cache disable caching for the file server
--no-dir turn off directory listing
--no-dot disable serving of dot files
-p, --port int port to serve on (default 8000)
-v, --version version for fileserve
```Or use the module to create your own portable:
* [nextjs-portable example](_examples/nextjs-portable)## License
[MIT](LICENCE)