From c712a8b6e2b54510eca472dc06f401c76d36ef32 Mon Sep 17 00:00:00 2001 From: kjs Date: Wed, 12 Aug 2026 17:25:33 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EA=B8=B0=EB=B3=B8=20=ED=8B=80:=20=ED=97=A4?= =?UTF-8?q?=EB=8D=94=C2=B7=EC=BD=98=ED=85=90=EC=B8=A0=20=EC=B9=B4=EB=93=9C?= =?UTF-8?q?=C2=B7=ED=91=B8=ED=84=B0=20+=20DB=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- src/app/page.tsx | 60 +++++++++++++++++++++++++++++-------- src/components/DbStatus.tsx | 33 ++++++++++++++++++++ 2 files changed, 81 insertions(+), 12 deletions(-) create mode 100644 src/components/DbStatus.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index 1d88f1c..66c27a8 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,16 +1,52 @@ +import DbStatus from "@/components/DbStatus"; + export default function Home() { return ( -
-

jskim.vexplor.com

-

- Next.js + PostgreSQL 프로젝트가 준비되었습니다. -

- - DB 연결 상태 확인 → /api/health - -
+
+ {/* 헤더 */} +
+
+ jskim + +
+
+ + {/* 메인 */} +
+
+

메인 페이지

+

+ jskim.vexplor.com — Next.js + PostgreSQL 기본 틀 +

+
+ +
+
+ + {/* 콘텐츠 카드 자리 */} +
+ {["섹션 A", "섹션 B", "섹션 C"].map((title) => ( +
+

{title}

+

+ 콘텐츠가 들어갈 자리입니다. +

+
+ ))} +
+
+ + {/* 푸터 */} +
+ jskim.vexplor.com · dev-pilots +
+
); } diff --git a/src/components/DbStatus.tsx b/src/components/DbStatus.tsx new file mode 100644 index 0000000..75fe6a0 --- /dev/null +++ b/src/components/DbStatus.tsx @@ -0,0 +1,33 @@ +"use client"; + +import { useEffect, useState } from "react"; + +type Health = { + status: string; + db: { connected: boolean; now?: string; version?: string }; +}; + +export default function DbStatus() { + const [health, setHealth] = useState(null); + const [error, setError] = useState(false); + + useEffect(() => { + fetch("/api/health") + .then((res) => res.json()) + .then(setHealth) + .catch(() => setError(true)); + }, []); + + if (error) + return ● API 응답 없음; + if (!health) + return ● 확인 중…; + + return health.db.connected ? ( + + ● DB 연결됨 (PostgreSQL) + + ) : ( + ● DB 연결 안 됨 + ); +}