A simple password gated Express API to manage an AWS S3 bucket.
- Clone the repository:
git clone https://github.com/kunalbagaria/s3-express-upload.git
- Install dependencies:
cd s3-express-upload
bun install
- Edit
.env.sample
file to.env
and fill in the required environment variables:
# S3 Bucket and Region
AWS_REGION="your-region"
AWS_BUCKET="your-bucket-name"
AWS_ACCESS_KEY_ID="your-access-key-id"
AWS_SECRET_ACCESS_KEY="your-secret-access-key"
# Cloudfront
CLOUDFRONT_DOMAIN="your-cloudfront-domain"
# Authentication
PASSWORD="your-secure-password"
# Miscellaneous
SERVER_URL="http://localhost:8080/"
- Start the server:
bun dev
The API will be accessible at http://localhost:8080
.
All routes except the root (/
) require authentication. Include the Authorization
header with the value <password>
in your requests.
GET /
: Returns a welcome message.GET /api/v1/files/:startDate?/:endDate?
: Retrieve a list of all files in your storage.POST /api/v1/upload-file
: Upload files to your S3 Bucket.
Contributions are welcome! Please follow the standard GitHub workflow:
- Fork the repository
- Create a new branch for your feature or bug fix
- Commit your changes
- Open a pull request against the
main
branch
This project is licensed under the MIT License.