rmesh-online/src/app/api/internal/provision/route.ts

21 lines
615 B
TypeScript

import { NextResponse } from "next/server";
/**
* Internal provision endpoint -- called by rSpace Registry when activating
* rmesh for a space. No auth required (only reachable from Docker network).
*/
export async function POST(request: Request) {
const body = await request.json();
const space: string = body.space?.trim();
if (!space) {
return NextResponse.json({ error: "Missing space name" }, { status: 400 });
}
const ownerDid: string = body.owner_did || "";
return NextResponse.json({
status: "ok",
space,
owner_did: ownerDid,
message: "rmesh space acknowledged",
});
}