You can POST / GET / list files to this server.
- upload file: POST http://localhost:3000/upload
- download file: GET http://localhost:3000/download/file.ext
- list files: GET http://localhost:3000/files
Try to upload a file using the following command:
upload:
curl -v -F "file=@/path/to/file.ext" http://localhost:3000/upload
curl -v -F "file=@/path/to/some.zip;filename=fancy.zip" http://localhost:3000/uploaddownload:
curl -O http://localhost:3000/download/file.ext
curl -O http://localhost:3000/download/fancy.ziplist files:
curl http://localhost:3000/filesCompress files:
tar -cf compressed.tar /path/to/directory
tar -cf - /path/to/directory | pigz > compressed.tar.gz
tar -czf compressed.tar.gz /path/to/directoryDecompress files:
tar -xf compressed.tar
tar -xzf compressed.tar.gzBuild docker image
docker build -t go-file-server .Run docker image
docker run -p 3000:3000 go-file-server
# or use existing docker image
docker run -p 3000:3000 rankun203/go-file-serverVisit http://localhost:3000.