Files
OllaHub/app/api/ollama/health/route.ts
T
Evandro Fonseca Junior a3f8226fda docs: replace README with Next.js boilerplate template
Updated README.md from a detailed OllaHub project description to the standard Next.js getting started template, likely to initialize or reset the project as a Next.js application.
2025-10-28 12:51:19 -03:00

19 lines
442 B
TypeScript

import { NextResponse } from "next/server";
import { listModelsViaSdk, listModelsViaHttp } from "@/lib/ollama";
export const dynamic = "force-dynamic";
export async function GET() {
try {
try {
await listModelsViaSdk();
return NextResponse.json({ ok: true });
} catch {
await listModelsViaHttp();
return NextResponse.json({ ok: true });
}
} catch {
return NextResponse.json({ ok: false });
}
}