import { buildConfig } from "payload"; import { postgresAdapter } from "@payloadcms/db-postgres"; import { lexicalEditor } from "@payloadcms/richtext-lexical"; import path from "path"; import { fileURLToPath } from "url"; import { Users } from "./collections/Users"; import { Articles } from "./collections/Articles"; import { Services } from "./collections/Services"; import { Testimonials } from "./collections/Testimonials"; import { Media } from "./collections/Media"; const filename = fileURLToPath(import.meta.url); const dirname = path.dirname(filename); export default buildConfig({ admin: { user: Users.slug, meta: { titleSuffix: " | Der-topogo Admin", }, }, collections: [Users, Articles, Services, Testimonials, Media], editor: lexicalEditor(), secret: process.env.PAYLOAD_SECRET || "CHANGE-ME-IN-PRODUCTION", typescript: { outputFile: path.resolve(dirname, "payload-types.ts"), }, db: postgresAdapter({ pool: { connectionString: process.env.DATABASE_URI || "", }, }), });