In an effort to keep the Examples Directory as easy to navigate as possible, and to keep the Payload Monorepo only as verbose as it needs to be, we need to remove all alternatives from the Examples Directory. This includes setups that interact with Payload from a standalone server, keeping only the Payload recommended "combined" Next.js + Payload setups.
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
import { slateEditor } from '@payloadcms/richtext-slate'
|
|
import { fileURLToPath } from 'node:url'
|
|
import path from 'path'
|
|
import { buildConfig } from 'payload'
|
|
|
|
import { Pages } from './collections/Pages'
|
|
import { Users } from './collections/Users'
|
|
import { MainMenu } from './globals/MainMenu'
|
|
|
|
const filename = fileURLToPath(import.meta.url)
|
|
const dirname = path.dirname(filename)
|
|
|
|
// eslint-disable-next-line no-restricted-exports
|
|
export default buildConfig({
|
|
admin: {
|
|
importMap: {
|
|
baseDir: path.resolve(dirname),
|
|
},
|
|
},
|
|
collections: [Pages, Users],
|
|
cors: [process.env.NEXT_PUBLIC_SERVER_URL || ''].filter(Boolean),
|
|
csrf: [process.env.NEXT_PUBLIC_SERVER_URL || ''].filter(Boolean),
|
|
db: mongooseAdapter({
|
|
url: process.env.DATABASE_URI || '',
|
|
}),
|
|
editor: slateEditor({}),
|
|
globals: [MainMenu],
|
|
graphQL: {
|
|
schemaOutputFile: path.resolve(dirname, 'generated-schema.graphql'),
|
|
},
|
|
secret: process.env.PAYLOAD_SECRET || '',
|
|
typescript: {
|
|
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
|
},
|
|
})
|