feat: add /api/projects endpoint

This commit is contained in:
2026-03-04 01:56:47 +08:00
parent 7609e99076
commit 5be115d323

15
app/api/projects/route.ts Normal file
View File

@@ -0,0 +1,15 @@
// app/api/projects/route.ts
import { NextResponse } from 'next/server';
import { getProjects } from '@/lib/fs-utils';
export async function GET() {
try {
const projects = await getProjects();
return NextResponse.json(projects);
} catch (error) {
return NextResponse.json(
{ error: 'Failed to fetch projects' },
{ status: 500 }
);
}
}