Next.js 16 + Tailwind v4 + shadcn v4 dashboard for managing a modded Forge 1.20.1 server. Includes server controls, player management, mod manager with Modrinth search and dependency resolution, world backups, snapshots, analytics, logs, and chat bridge. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
21 lines
528 B
TypeScript
21 lines
528 B
TypeScript
import { NextRequest, NextResponse } from "next/server";
|
|
import { searchMods } from "@/lib/modrinth";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET(req: NextRequest) {
|
|
const query = req.nextUrl.searchParams.get("q");
|
|
if (!query || query.length < 2) {
|
|
return NextResponse.json([]);
|
|
}
|
|
|
|
try {
|
|
const results = await searchMods(query);
|
|
return NextResponse.json(results);
|
|
} catch (e) {
|
|
return NextResponse.json(
|
|
{ error: (e as Error).message },
|
|
{ status: 500 }
|
|
);
|
|
}
|
|
}
|