VIBN Frontend for Coolify deployment

This commit is contained in:
2026-02-15 19:25:52 -08:00
commit 40bf8428cd
398 changed files with 76513 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import { NextResponse } from 'next/server';
import { v0 } from 'v0-sdk';
export async function POST(request: Request) {
try {
const { chatId, message, projectId } = await request.json();
if (!chatId || !message) {
return NextResponse.json(
{ error: 'Missing required fields: chatId and message' },
{ status: 400 }
);
}
console.log(`[API] Iterate request for chat ${chatId}`);
// The v0 SDK doesn't support sending follow-up messages via API
// Users need to continue the conversation on v0.dev
const webUrl = `https://v0.dev/chat/${chatId}`;
return NextResponse.json({
success: true,
chatId: chatId,
webUrl: webUrl,
message: 'To continue this conversation, please visit the chat on v0.dev',
note: 'The v0 API does not currently support sending follow-up messages. Use the web interface to iterate on your design.',
yourMessage: message,
});
} catch (error) {
console.error('[API] Error processing iteration request:', error);
return NextResponse.json(
{
error: error instanceof Error ? error.message : 'Failed to process request',
details: error instanceof Error ? error.stack : undefined,
},
{ status: 500 }
);
}
}