Skip to content

KunalBagaria/s3-express-upload

Repository files navigation

S3-Express-Upload

A simple password gated Express API to manage an AWS S3 bucket.

Deploy on Railway

Installation

  1. Clone the repository:
git clone https://github.com/kunalbagaria/s3-express-upload.git
  1. Install dependencies:
cd s3-express-upload
bun install
  1. 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/"
  1. Start the server:
bun dev

The API will be accessible at http://localhost:8080.

Usage

Authentication

All routes except the root (/) require authentication. Include the Authorization header with the value <password> in your requests.

API Endpoints

  • 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.

Contributing

Contributions are welcome! Please follow the standard GitHub workflow:

  1. Fork the repository
  2. Create a new branch for your feature or bug fix
  3. Commit your changes
  4. Open a pull request against the main branch

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published