A http file server written by golang and reactjs.
Binary can be download from gorelease
file-server -port 8000 -root /your/workdir
file-server
-port=8000: Which port to listen
-private=false: Only listen on lookback interface, otherwise listen on all interface
-root=".": the HTTP File Server's root directory
-auth="": Basic Authentication (ex: username:password)
- Support QRCode code generate
- All assets package to Standalone binary
- Different file type different icon
- Support show or hide hidden files
- Upload support
- README.md preview
- HTTP Basic Auth
- Gzip support
- When only one dir under dir, path will combine two together
Suggest install node through nvm
npm install -g webpack
npm install
make prod
Your need to know what is react, and golang. In develop mode, Support react hot reload
npm install
make dev
Open another terminal
go build && ./file-server
Upload
POST /upload-dir
Field name | Description | Example |
---|---|---|
file | Upload file | file=@upload.txt |
path | Upload path(optional) | path=/tmp/ |
name | Save name (optional, need version set) | name=foo |
version | Upload version | version=1.2.0 |
Use CURL
# Normal upload
curl -F file=@upload.txt ${SERVER}
# Versioned upload
curl -F file=@foo-windows.txt -F file=@foo-mac.txt -F name=foo -F version=1.0.1 ${SERVER}
# will create dir structure
foo/
|- foo-latest(symlink) -> foo-1.0.1
`- foo-1.0.1/
|- foo-windows.txt
`- foo-mac.txt