2026-09-09 09:02:46 +00:00
|
|
|
import { buildConfig } from "payload";
|
|
|
|
|
import { postgresAdapter } from "@payloadcms/db-postgres";
|
2026-09-11 19:00:43 +00:00
|
|
|
import { translations } from "@payloadcms/translations/all";
|
2026-09-09 09:53:07 +00:00
|
|
|
import { HomeContent } from "./src/collections/HomeContent.ts";
|
|
|
|
|
import { Media } from "./src/collections/Media.ts";
|
|
|
|
|
import { Products } from "./src/collections/Products.ts";
|
|
|
|
|
import { SiteSettings } from "./src/collections/SiteSettings.ts";
|
|
|
|
|
import { Users } from "./src/collections/Users.ts";
|
2026-09-09 09:02:46 +00:00
|
|
|
|
2026-09-11 19:00:43 +00:00
|
|
|
const serverURL = new URL(process.env.PAYLOAD_PUBLIC_SERVER_URL || "https://www.kaotings.com").origin;
|
|
|
|
|
|
2026-09-09 09:02:46 +00:00
|
|
|
export default buildConfig({
|
2026-09-11 19:00:43 +00:00
|
|
|
serverURL,
|
|
|
|
|
admin: {
|
|
|
|
|
user: Users.slug,
|
|
|
|
|
components: {
|
|
|
|
|
logout: {
|
|
|
|
|
Button: "/src/components/CmsLogoutButton.tsx#CmsLogoutButton",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-09-09 09:02:46 +00:00
|
|
|
collections: [Users, Products, Media],
|
|
|
|
|
globals: [SiteSettings, HomeContent],
|
2026-09-11 19:00:43 +00:00
|
|
|
i18n: {
|
|
|
|
|
fallbackLanguage: "zh",
|
|
|
|
|
supportedLanguages: {
|
|
|
|
|
en: translations.en,
|
|
|
|
|
zh: translations.zh,
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-09-09 09:02:46 +00:00
|
|
|
secret: process.env.PAYLOAD_SECRET || "development-only-change-me",
|
|
|
|
|
db: postgresAdapter({ pool: { connectionString: process.env.DATABASE_URI || "" } }),
|
|
|
|
|
typescript: { outputFile: "./src/payload-types.ts" },
|
|
|
|
|
});
|