-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayload.config.ts
53 lines (50 loc) · 1.58 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
47
48
49
50
51
52
53
// storage-adapter-import-placeholder
import { mongooseAdapter } from '@payloadcms/db-mongodb';
import { lexicalEditor } from '@payloadcms/richtext-lexical';
import path from 'path';
import { buildConfig } from 'payload';
import { fileURLToPath } from 'url';
import sharp from 'sharp';
import { resendAdapter } from '@payloadcms/email-resend'
import { Users } from './collections/Users';
import { Media } from './collections/Media';
import { uploadthingStorage } from '@payloadcms/storage-uploadthing';
import { Projects } from './collections/Projects';
import MainPage from './globals/MainPage';
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
export default buildConfig({
admin: {
user: Users.slug,
importMap: {
baseDir: path.resolve(dirname),
},
},
collections: [Users, Media, Projects],
globals: [MainPage],
editor: lexicalEditor(),
secret: process.env.PAYLOAD_SECRET || '',
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'),
},
db: mongooseAdapter({
url: process.env.DATABASE_URI || '',
}),
sharp,
plugins: [
uploadthingStorage({
collections: {
["media"]: true,
},
options: {
apiKey: process.env.UPLOADTHING_SECRET,
acl: 'public-read',
},
}),
],
email: resendAdapter({
defaultFromAddress: 'hello@kamilmarczak.pl',
defaultFromName: 'Kamil Marczak - Admin',
apiKey: process.env.RESEND_API_KEY || '',
}),
});