-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpayload.config.ts
More file actions
35 lines (33 loc) · 1.08 KB
/
payload.config.ts
File metadata and controls
35 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import sharp from 'sharp'
import { mongooseAdapter } from '@payloadcms/db-mongodb'
import { buildConfig, type Plugin } from 'payload'
import { Users } from './src/collections/Users'
import { Teams } from './src/collections/Teams'
import { Matches } from './src/collections/Matches'
import { Players } from './src/collections/Players'
import { Media } from './src/collections/Media'
import { vercelBlobStorage } from '@payloadcms/storage-vercel-blob'
// Only use Vercel Blob storage when the token is available (production / Vercel).
// Locally, Payload falls back to its built-in local file storage (./media).
const plugins: Plugin[] = []
if (process.env.BLOB_READ_WRITE_TOKEN) {
plugins.push(
vercelBlobStorage({
collections: {
media: {
disablePayloadAccessControl: true,
},
},
token: process.env.BLOB_READ_WRITE_TOKEN,
}),
)
}
export default buildConfig({
collections: [Users, Teams, Matches, Players, Media],
secret: process.env.PAYLOAD_SECRET || '',
db: mongooseAdapter({
url: process.env.DATABASE_URL || '',
}),
plugins,
sharp,
})