운영 시작 버전 v1.0.0 정리

This commit is contained in:
2026-05-14 10:49:25 +09:00
parent 069d1bfbd4
commit 3b331b8fe6
18 changed files with 1679 additions and 94 deletions

View File

@@ -2,6 +2,12 @@ import postgres from 'postgres'
let client = null
/**
* 현재 실행 환경이 운영인지 확인한다.
* @returns {boolean} 운영 환경 여부
*/
const isProductionRuntime = () => process.env.NODE_ENV === 'production'
/**
* PostgreSQL 클라이언트 조회
* @returns {ReturnType<typeof postgres> | null} PostgreSQL 클라이언트
@@ -10,6 +16,10 @@ export const getPostgresClient = () => {
const config = useRuntimeConfig()
if (!config.databaseUrl) {
if (isProductionRuntime()) {
throw new Error('DATABASE_URL_REQUIRED')
}
return null
}