Deploy app

This commit is contained in:
2026-01-03 21:34:35 +01:00
parent 07a37f92df
commit 9d41823e87
9 changed files with 70 additions and 22 deletions
+4 -3
View File
@@ -2,10 +2,11 @@ import { NextRequest, NextResponse } from "next/server";
import testAuth from "../auth";
import { StatusCodes } from "http-status-codes";
import { deployApp, getDeployments } from "@/core/deployment";
import { Application } from "@/lib/types";
export async function POST(req: NextRequest): Promise<NextResponse> {
const auth = await testAuth(req);
const { name, appId }: { name: string; appId: string } = await req.json();
const { name, app }: { name: string; app: Application } = await req.json();
if (auth) {
return NextResponse.json(
@@ -14,14 +15,14 @@ export async function POST(req: NextRequest): Promise<NextResponse> {
);
}
if (!name || !appId) {
if (!name || !app) {
return NextResponse.json(
{ message: "Body missing name, appId, nodeId" },
{ status: StatusCodes.BAD_REQUEST }
);
}
const deployId = await deployApp(name, appId);
const deployId = await deployApp(name, app);
return NextResponse.json({
message: "ok",