Skip to content

porameht/file-service-rustfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

file-service

REST API for file storage using RustFS (S3-compatible).

Quick Start

# Start RustFS
docker compose up -d

# Run service
RUSTFS_ENDPOINT=http://127.0.0.1:9000 cargo run

Environment Variables

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

API

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"

About

REST API for file storage using RustFS (S3-compatible).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages