Files
rednote-tool-studio/app/api/projects/[id]/route.ts
T
2026-09-17 21:54:33 +08:00

14 lines
517 B
TypeScript

import { NextResponse } from "next/server";
import { errorResponse } from "../../../../lib/http";
import { getProject, listFiles } from "../../../../lib/storage";
export const runtime = "nodejs";
export async function GET(_: Request, context: { params: Promise<{ id: string }> }) {
try {
const { id } = await context.params;
const [project, files] = await Promise.all([getProject(id), listFiles(id)]);
return NextResponse.json({ project, files });
} catch (error) { return errorResponse(error); }
}