Files
portabase/app/api/init/route.ts
T

24 lines
582 B
TypeScript
Raw Normal View History

2025-05-16 15:54:17 +02:00
import { NextResponse } from "next/server";
2025-01-03 20:48:58 +01:00
export type BodyInit = {
2025-05-16 15:54:17 +02:00
initialize: boolean;
};
2025-01-03 20:48:58 +01:00
2025-05-16 15:54:17 +02:00
export async function POST(request: Request) {
2025-01-03 20:48:58 +01:00
try {
const body: BodyInit = await request.json();
2025-05-16 15:54:17 +02:00
console.log(body);
2025-01-03 20:48:58 +01:00
return NextResponse.json(
{
message: "Initialization successfully done!",
},
{ status: 200 }
);
} catch (error) {
console.error("Error in POST initialization:", error);
2025-05-16 15:54:17 +02:00
return NextResponse.json({ error: "Internal server error" }, { status: 500 });
2025-01-03 20:48:58 +01:00
}
2025-05-16 15:54:17 +02:00
}