-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpayload.config.ts
More file actions
62 lines (59 loc) · 1.67 KB
/
Copy pathpayload.config.ts
File metadata and controls
62 lines (59 loc) · 1.67 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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'
import { en } from '@payloadcms/translations/languages/en'
import { pl } from '@payloadcms/translations/languages/pl'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
export default buildConfig({
admin: {
user: Users.slug,
importMap: {
baseDir: path.resolve(dirname),
},
},
i18n: {
supportedLanguages: { en, pl },
fallbackLanguage: 'en',
},
localization: {
locales: ['en', 'pl'],
defaultLocale: 'en',
},
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: {
token: process.env.UPLOADTHING_TOKEN,
acl: 'public-read',
},
}),
],
email: resendAdapter({
defaultFromAddress: 'hello@kamilmarczak.pl',
defaultFromName: 'Kamil Marczak - Admin',
apiKey: process.env.RESEND_API_KEY || '',
}),
})