From 36ebf543572e49ffc6c918c1d006d5ba94ab7f0f Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Sat, 11 Oct 2025 08:11:13 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`feature?= =?UTF-8?q?/make-self-hostable`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @Yavnik. * https://github.com/Yavnik/commandops/pull/1#issuecomment-3393043646 The following files were modified: * `src/app/api/health/route.ts` * `src/db/index.ts` --- src/app/api/health/route.ts | 7 ++++++- src/db/index.ts | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/api/health/route.ts b/src/app/api/health/route.ts index 9146308..d056717 100644 --- a/src/app/api/health/route.ts +++ b/src/app/api/health/route.ts @@ -1,3 +1,8 @@ +/** + * Handles GET requests for the health endpoint by returning a JSON health-check payload. + * + * @returns A Response whose JSON body is { ok: true }. + */ export async function GET() { return Response.json({ ok: true }); -} +} \ No newline at end of file diff --git a/src/db/index.ts b/src/db/index.ts index 7018a5b..c544c9e 100644 --- a/src/db/index.ts +++ b/src/db/index.ts @@ -1,6 +1,12 @@ import { drizzle } from 'drizzle-orm/postgres-js'; import postgres from 'postgres'; +/** + * Retrieve the DATABASE_URL environment variable. + * + * @returns The `DATABASE_URL` string. + * @throws Error if the `DATABASE_URL` environment variable is not set. + */ function requireDatabaseUrl(): string { const url = process.env.DATABASE_URL; if (!url) throw new Error('DATABASE_URL is required');