go-static

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 12 Imported by: 0

README

go-static

A simple file server that runs locally on your PC, written in Go.

Running

To run go-static, you can download binary for your system in Releases page. But you can also install latest build by running:

go install github.com/ref-err/go-static@latest

Usage

Command-line arguments:
  • --port=PORT: Server HTTP port (default: 8080)
  • --root="path/to/dir": Serve files from this directory (default: current directory)
  • --version: Prints version of go-static
  • --open: Opens file server in default browser
Example
go-static --port=3000 --root="$HOME/public" 

This command runs a file server at port 3000 and a root directory public in the user's home.

Building

To build this program, you can run:

go build -o "build/go-static"

To build AND run:

go run . <go-static args> # (for example: --port=3000 --root="$HOME")

To build for other OS and other architecture:

GOOS=windows GOARCH=amd64 go build -o "build/go-static.exe"

License

This program is licensed under the MIT License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL