Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/app/api/health/route.ts
Original file line number Diff line number Diff line change
@@ -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 });
}
}
6 changes: 6 additions & 0 deletions src/db/index.ts
Original file line number Diff line number Diff line change
@@ -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');
Expand Down