-
Notifications
You must be signed in to change notification settings - Fork 0
/
payload.config.ts
46 lines (43 loc) · 1.34 KB
/
payload.config.ts
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
36
37
38
39
40
41
42
43
44
45
46
import { postgresAdapter } from '@payloadcms/db-postgres'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import path from 'path'
import { buildConfig } from 'payload'
import { fileURLToPath } from 'url'
import { vercelBlobStorage } from '@payloadcms/storage-vercel-blob'
import Users from './collections/Users'
import { Media } from './collections/Media'
import Places from './collections/Places'
import sharp from 'sharp'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
export default buildConfig({
admin: {
user: Users.slug,
},
collections: [Users, Media, Places],
editor: lexicalEditor(),
cors: ['*'],
secret: process.env.PAYLOAD_SECRET || 'test',
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'),
},
sharp,
db: postgresAdapter({
pool: {
connectionString: process.env.DATABASE_URI || '',
},
}),
plugins: [
// storage-adapter-placeholder
vercelBlobStorage({
enabled: true, // Optional, defaults to true
// Specify which collections should use Vercel Blob
collections: {
[Media.slug]: true,
},
// Token provided by Vercel once Blob storage is added to your Vercel project
token: process.env.BLOB_READ_WRITE_TOKEN || 'vercel_blob_rw_somefakeid_nonce',
cacheControlMaxAge: 60,
}),
],
})