16 lines
569 B
TypeScript
16 lines
569 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { buildProject } from "../../../../../lib/build";
|
|
import { errorResponse } from "../../../../../lib/http";
|
|
import { touchProject } from "../../../../../lib/storage";
|
|
|
|
export const runtime = "nodejs";
|
|
|
|
export async function POST(_: Request, context: { params: Promise<{ id: string }> }) {
|
|
try {
|
|
const { id } = await context.params;
|
|
await touchProject(id);
|
|
const result = await buildProject(id);
|
|
return NextResponse.json({ report: result.report });
|
|
} catch (error) { return errorResponse(error); }
|
|
}
|