Files
website-enchun-mgr/apps/backend/scripts/migration/test-env.ts
pkupuk be7fc902fb feat(backend): update collections, config and migration tools
Update Payload CMS configuration, collections (Audit, Posts), and add migration scripts/reports.
2026-02-11 11:50:23 +08:00

16 lines
606 B
TypeScript

#!/usr/bin/env tsx
import { config as dotenvConfig } from 'dotenv'
import { resolve, dirname } from 'path'
import { fileURLToPath } from 'url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const envPath = resolve(__dirname, '../../.env')
console.log('Loading .env from:', envPath)
const result = dotenvConfig({ path: envPath })
console.log('dotenv result:', result.error ? result.error.message : 'success')
console.log('PAYLOAD_SECRET:', process.env.PAYLOAD_SECRET ? 'SET' : 'NOT SET')
console.log('DATABASE_URI:', process.env.DATABASE_URI ? 'SET' : 'NOT SET')