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