happy-server/sources/storage/files.ts
2025-08-26 21:46:55 -07:00

23 lines
558 B
TypeScript

import * as Minio from 'minio';
export const s3client = new Minio.Client({
endPoint: process.env.S3_HOST!,
useSSL: true,
accessKey: process.env.S3_ACCESS_KEY!,
secretKey: process.env.S3_SECRET_KEY!,
});
export const s3bucket = process.env.S3_BUCKET!;
export const s3host = process.env.S3_HOST!
export async function loadFiles() {
await s3client.bucketExists(s3bucket); // Throws if bucket does not exist or is not accessible
}
export type ImageRef = {
width: number;
height: number;
thumbhash: string;
path: string;
}