import config from "@/config"; import { S3Client } from "bun"; export const s3 = new S3Client({ accessKeyId: config.data.s3.accessKeyId, secretAccessKey: config.data.s3.secretAccessKey, bucket: config.data.s3.bucket, endpoint: config.data.s3.endpoint, region: config.data.s3.region, }); export function getPublicUrl(key: string) { if (config.data.s3.publicUrl) { return `${config.data.s3.publicUrl}/${key}`; } return s3.file(key).presign({ expiresIn: 3600 }); }