Welcome to gofs 👋
This is a simple fileserver tool to expose a file or directory locally.
The tool also has the option to rebind the url to a different path when exposing.
It is written in Go.
Install
go get github.com/floholz/gofs
Usage
To expose the current directory, simply run the package. By default, the directory will be exposed at http://localhost:8080/
go run github.com/floholz/gofs
Instead of the active directory, you can choose a file or directory to expose by passing it as an argument.
go run github.com/floholz/gofs ~/my-direcory/my-file.txt
To set the url, your file or directory should be exposed to, use the --url
or -u
flag.
go run github.com/floholz/gofs ~/my-direcory/my-file.txt --url 0.0.0.0:3003/path-to-file/file.json
By leaving the hostname
, port
or path
empty, it will be set to its default value.
URL part |
default value |
scheme |
is always set to http: |
hostname |
localhost |
port |
8080 |
path (directory) |
/ |
path (file) |
/filename.ext |
Examples for --url
parsing
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
📝 License
Copyright © 2024 floholz.
This project is MIT licensed.
Show your support
Give a ⭐ if this project helped you!