Skip to content

Commit

Permalink
Update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Sep 20, 2024
1 parent 3dce782 commit 85ab773
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion s3-file-provider/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# S3 File Provider

Example of using FileMiddleware to serve files stored on S3
Example of using FileMiddleware to serve and cache files stored on S3.

By providing a type conforming to `FileProvider` to `FileMiddleware` we can serve files from other sources than the local disk. This example creates two file providers, one that serves files from an S3 bucket and one that takes a base FileProvider and caches its results in memory. These two are combined to create a FileProvider that sources files from S3 and caches them in memory.

The example needs two environment variables:
- `s3_file_region`: Defines the AWS region to use eg us-east-1
- `s3_file_bucket`: The name of the bucket to serve files from

There is an optional environment variable:
- `s3_file_path`: Prefix to add when generating S3 file path.

0 comments on commit 85ab773

Please sign in to comment.