initial commit
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { buildConfig } from 'payload';
|
||||
import { postgresAdapter } from '@payloadcms/db-postgres';
|
||||
import { lexicalEditor } from '@payloadcms/richtext-lexical';
|
||||
|
||||
import { Users } from './collections/Users';
|
||||
import { Media } from './collections/Media';
|
||||
import { Articles } from './collections/Articles';
|
||||
import { Authors } from './collections/Authors';
|
||||
import { Categories } from './collections/Categories';
|
||||
import { Tags } from './collections/Tags';
|
||||
import { Editions } from './collections/Editions';
|
||||
import { Subscribers } from './collections/Subscribers';
|
||||
|
||||
import { revalidateAstro } from './hooks/revalidateAstro';
|
||||
|
||||
const filename = fileURLToPath(import.meta.url);
|
||||
const dirname = path.dirname(filename);
|
||||
|
||||
const corsOrigins = (process.env.CORS_ORIGINS || '')
|
||||
.split(',')
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean);
|
||||
|
||||
export default buildConfig({
|
||||
serverURL: process.env.SERVER_URL,
|
||||
cors: corsOrigins,
|
||||
csrf: corsOrigins,
|
||||
admin: {
|
||||
user: Users.slug,
|
||||
importMap: { baseDir: path.resolve(dirname) },
|
||||
meta: {
|
||||
titleSuffix: ' · SoftVowels CMS',
|
||||
},
|
||||
},
|
||||
collections: [Users, Media, Articles, Authors, Categories, Tags, Editions, Subscribers],
|
||||
editor: lexicalEditor(),
|
||||
secret: process.env.PAYLOAD_SECRET || 'dev-secret-change-me',
|
||||
typescript: {
|
||||
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
||||
},
|
||||
db: postgresAdapter({
|
||||
pool: {
|
||||
connectionString: process.env.DATABASE_URI || '',
|
||||
},
|
||||
}),
|
||||
sharp: (sharp) => sharp,
|
||||
upload: {
|
||||
limits: {
|
||||
fileSize: 25_000_000,
|
||||
},
|
||||
},
|
||||
endpoints: [],
|
||||
hooks: {
|
||||
afterChange: [revalidateAstro],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user