Forked from Forthena (PERSONAL/forthena) and retargeted: - NO login, NO LLM: the edition is public and the ranking is deterministic (stories that name Sen. BAM lead; freshest first) — Daniel: no like/dislike or store profile for visitors. - Crawler scoped to BAM: Bing news keyword queries + Inquirer/Rappler fallback wires, with a two-tier relevance gate (named-BAM always; Aquino+legislative-context only from fallback) so op-eds and non-Bam senators are dropped. - Desks: BAM (lead), Gaming, Education, Politics, Energy, PH, Business. - Community board /board: 'Thank you Senator BAM' — nickname-only posts, HTML-stripped, URL-only rejected, IP rate-limited (3/10min, 20/day). - Yellow-gamer theme (Orbitron/Rajdhani/JetBrains Mono, dark + gold, HUD corners), supporter disclaimer in header and footer. - Tests: category/date/relevance/text suites + Mongo board suite + full HTTP e2e (all passing). Infra: 66.181.46.132 (bidaangmamamayan.com), local Mongo 7.0, nginx + certbot TLS, PM2 bama (:3000) + 15-min crawl cron.
24 lines
806 B
JavaScript
24 lines
806 B
JavaScript
import { NextResponse } from "next/server";
|
|
|
|
// Liveness probe (nginx/monitoring). Public. Reports the process is up and
|
|
// pings Mongo so a DB outage is visible here, not hidden behind a 200 feed.
|
|
//
|
|
// NOTE the double await is REQUIRED: getDb() is async (returns Promise<Db>).
|
|
// `await getDb().command(...)` would call .command on the PROMISE and throw
|
|
// "command is not a function" (caught in e2e 2026-09-15).
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET() {
|
|
let mongo = "unknown";
|
|
try {
|
|
const { getDb } = await import("../../../lib/db");
|
|
const db = await getDb();
|
|
await db.command({ ping: 1 });
|
|
mongo = "ok";
|
|
} catch {
|
|
mongo = "down";
|
|
}
|
|
return NextResponse.json({ ok: true, service: "bidaangmamamayan", mongo, time: new Date().toISOString() });
|
|
}
|