REST API for file storage using RustFS (S3-compatible).
# Start RustFS
docker compose up -d
# Run service
RUSTFS_ENDPOINT=http://127.0.0.1:9000 cargo run| Variable | Default | Description |
|---|---|---|
RUSTFS_ENDPOINT |
http://localhost:9000 |
RustFS endpoint |
RUSTFS_ACCESS_KEY |
rustfsadmin |
Access key |
RUSTFS_SECRET_KEY |
rustfsadmin |
Secret key |
RUSTFS_BUCKET |
files |
Bucket name |
ADDR |
0.0.0.0:3000 |
Server address |
Content is base64 encoded.
# List files
curl http://localhost:3000/files
curl "http://localhost:3000/files?path=/mydir"
# Read file
curl "http://localhost:3000/files/read?path=/hello.txt"
# Write file
curl -X POST http://localhost:3000/files \
-H "Content-Type: application/json" \
-d '{"path":"/hello.txt","content":"SGVsbG8gV29ybGQh"}'
# Create directory
curl -X POST "http://localhost:3000/files/mkdir?path=/mydir"
# Delete
curl -X DELETE "http://localhost:3000/files?path=/hello.txt"