feat: add support for s3 bucket for media
This commit is contained in:
@@ -1 +1,6 @@
|
||||
export const importMap = {};
|
||||
import { S3ClientUploadHandler as S3ClientUploadHandler_f97aa6c64367fa259c5bc0567239ef24 } from '@payloadcms/storage-s3/client';
|
||||
|
||||
export const importMap = {
|
||||
'@payloadcms/storage-s3/client#S3ClientUploadHandler':
|
||||
S3ClientUploadHandler_f97aa6c64367fa259c5bc0567239ef24,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { postgresAdapter } from '@payloadcms/db-postgres';
|
||||
import { lexicalEditor } from '@payloadcms/richtext-lexical';
|
||||
import { s3Storage } from '@payloadcms/storage-s3';
|
||||
import { NodeHttpHandler } from '@smithy/node-http-handler';
|
||||
import https from 'https';
|
||||
import path from 'path';
|
||||
import { buildConfig } from 'payload';
|
||||
import sharp from 'sharp';
|
||||
@@ -40,5 +43,26 @@ export default buildConfig({
|
||||
},
|
||||
}),
|
||||
sharp,
|
||||
plugins: [],
|
||||
plugins: [
|
||||
s3Storage({
|
||||
collections: {
|
||||
media: {
|
||||
disableLocalStorage: true,
|
||||
},
|
||||
},
|
||||
bucket: 'landing-cms',
|
||||
config: {
|
||||
endpoint: process.env.CMS_STORAGE_ENDPOINT,
|
||||
credentials: {
|
||||
accessKeyId: process.env.CMS_STORAGE_ACCESS_KEY_ID!,
|
||||
secretAccessKey: process.env.CMS_STORAGE_SECRET_ACCESS_KEY!,
|
||||
},
|
||||
region: process.env.CMS_STORAGE_REGION!,
|
||||
forcePathStyle: true,
|
||||
requestHandler: new NodeHttpHandler({
|
||||
httpsAgent: new https.Agent({ rejectUnauthorized: false }),
|
||||
}),
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user