61 lines
1.8 KiB
TypeScript
61 lines
1.8 KiB
TypeScript
![]() |
// storage-adapter-import-placeholder
|
||
|
import { mongooseAdapter } from "@payloadcms/db-mongodb"
|
||
|
import { HTMLConverterFeature, lexicalEditor } from "@payloadcms/richtext-lexical"
|
||
|
import path from "path"
|
||
|
import { buildConfig } from "payload"
|
||
|
import { fileURLToPath } from "url"
|
||
|
import sharp from "sharp"
|
||
|
|
||
|
import Authors from "./collections/Authors"
|
||
|
import { Media } from "./collections/Media"
|
||
|
import Articles from "./collections/Articles"
|
||
|
|
||
|
const filename = fileURLToPath(import.meta.url)
|
||
|
const dirname = path.dirname(filename)
|
||
|
export const allowed_hosts = process.env.ALLOWED_HOSTS ? process.env.ALLOWED_HOSTS.split(",") : ["*", "http://localhost:4321"]
|
||
|
|
||
|
export const server_url = process.env.PAYLOAD_PUBLIC_SERVER_URL
|
||
|
export const live_preview_url = process.env.PAYLOAD_PUBLIC_LIVE_PREVIEW_URL
|
||
|
export const preview_url = process.env.PAYLOAD_PUBLIC_PREVIEW_URL
|
||
|
export const draft_access_url = process.env.PAYLOAD_PUBLIC_DRAFT_ACCESS_URL
|
||
|
|
||
|
export default buildConfig({
|
||
|
admin: {
|
||
|
user: Authors.slug,
|
||
|
importMap: {
|
||
|
baseDir: path.resolve(dirname)
|
||
|
}
|
||
|
},
|
||
|
|
||
|
collections: [Authors, Media, Articles],
|
||
|
editor: lexicalEditor({
|
||
|
features: ({ defaultFeatures }) => [...defaultFeatures, HTMLConverterFeature({})]
|
||
|
}),
|
||
|
serverURL: process.env.SERVER_URL,
|
||
|
graphQL: {
|
||
|
// schemaOutputFile: path.resolve(__dirname, "generated-schema.graphql"),
|
||
|
disable: true,
|
||
|
disablePlaygroundInProduction: true
|
||
|
},
|
||
|
maxDepth: 10,
|
||
|
secret: process.env.PAYLOAD_SECRET || "",
|
||
|
typescript: {
|
||
|
outputFile: path.resolve(dirname, "payload-types.ts")
|
||
|
},
|
||
|
db: mongooseAdapter({
|
||
|
url: process.env.DATABASE_URI || ""
|
||
|
}),
|
||
|
sharp,
|
||
|
cors: allowed_hosts,
|
||
|
csrf: allowed_hosts,
|
||
|
upload: {
|
||
|
limits: {
|
||
|
fileSize: 50000000,
|
||
|
fieldSize: 10000000
|
||
|
}
|
||
|
},
|
||
|
plugins: [
|
||
|
// storage-adapter-placeholder
|
||
|
]
|
||
|
})
|