digital ocean spaces/aws S3 integratoin
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { S3 } from "@aws-sdk/client-s3";
|
||||
|
||||
const s3Client: S3 | undefined =
|
||||
process.env.SPACES_ENDPOINT &&
|
||||
process.env.SPACES_REGION &&
|
||||
process.env.SPACES_KEY &&
|
||||
process.env.SPACES_SECRET
|
||||
? new S3({
|
||||
forcePathStyle: false,
|
||||
endpoint: process.env.SPACES_ENDPOINT,
|
||||
region: process.env.SPACES_REGION,
|
||||
credentials: {
|
||||
accessKeyId: process.env.SPACES_KEY,
|
||||
secretAccessKey: process.env.SPACES_SECRET,
|
||||
},
|
||||
})
|
||||
: undefined;
|
||||
|
||||
export default s3Client;
|
||||
Reference in New Issue
Block a user