add cloudflare R2 config
This commit is contained in:
9297
apps/backend/cloudflare-env.d.ts
vendored
Normal file
9297
apps/backend/cloudflare-env.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,7 @@
|
||||
"@payloadcms/plugin-search": "3.56.0",
|
||||
"@payloadcms/plugin-seo": "3.56.0",
|
||||
"@payloadcms/richtext-lexical": "3.56.0",
|
||||
"@payloadcms/storage-r2": "^3.59.1",
|
||||
"@payloadcms/ui": "3.56.0",
|
||||
"@radix-ui/react-checkbox": "^1.0.4",
|
||||
"@radix-ui/react-label": "^2.0.2",
|
||||
|
||||
@@ -5,7 +5,7 @@ import sharp from 'sharp' // sharp-import
|
||||
import path from 'path'
|
||||
import { buildConfig, PayloadRequest } from 'payload'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import { r2Storage } from '@payloadcms/storage-r2'
|
||||
import { Categories } from './collections/Categories'
|
||||
import { Media } from './collections/Media'
|
||||
import { Pages } from './collections/Pages'
|
||||
@@ -70,8 +70,11 @@ export default buildConfig({
|
||||
].filter(Boolean),
|
||||
globals: [Header, Footer],
|
||||
plugins: [
|
||||
...plugins,
|
||||
// storage-adapter-placeholder
|
||||
r2Storage({
|
||||
bucket: cloudflare.env.R2,
|
||||
collections: { media: true },
|
||||
}),
|
||||
],
|
||||
secret: process.env.PAYLOAD_SECRET,
|
||||
sharp,
|
||||
|
||||
Reference in New Issue
Block a user