diff options
author | Linnnus <[email protected]> | 2025-02-19 18:37:33 +0100 |
---|---|---|
committer | Linnnus <[email protected]> | 2025-02-19 18:37:51 +0100 |
commit | f7a6244cc1a8f39ad44186a4da6b743ab6821d51 (patch) | |
tree | 54e63d1509f56caaac542a4548325f9716d42069 /app/src/lib/server/s3.ts | |
parent | 80a432fbda4ca2f35286197c636ad2a733ca4b5a (diff) |
Add assignment submission
Diffstat (limited to 'app/src/lib/server/s3.ts')
-rw-r--r-- | app/src/lib/server/s3.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/src/lib/server/s3.ts b/app/src/lib/server/s3.ts new file mode 100644 index 0000000..a1a28fa --- /dev/null +++ b/app/src/lib/server/s3.ts @@ -0,0 +1,16 @@ +import { S3Client } from "@aws-sdk/client-s3"; + +// We would obviously read from .env in prod, but it's an annoying indirection for this demo. +export function getS3Client(): S3Client { + const client = new S3Client({ + endpoint: "http://localhost:9000", + region: "us-east-1", // Required, but ignored for local usage. + credentials: { + accessKeyId: "minioadmin", + secretAccessKey: "minioadmin", + }, + forcePathStyle: true, // Required for local service since we obv. can't use subdomains. + }); + + return client; +} |