diff --git a/api/test.js b/api/test.js new file mode 100644 index 0000000..45284a1 --- /dev/null +++ b/api/test.js @@ -0,0 +1,35 @@ +import { NextResponse } from 'next/server'; + +export async function GET(request) { + try { + return NextResponse.json({ + success: true, + message: 'Test API is working!', + timestamp: new Date().toISOString() + }); + } catch (error) { + console.error('❌ Error in test API:', error); + return NextResponse.json( + { error: 'Test API failed', details: error.message }, + { status: 500 } + ); + } +} + +export async function POST(request) { + try { + const body = await request.json(); + return NextResponse.json({ + success: true, + message: 'Test POST API is working!', + receivedData: body, + timestamp: new Date().toISOString() + }); + } catch (error) { + console.error('❌ Error in test POST API:', error); + return NextResponse.json( + { error: 'Test POST API failed', details: error.message }, + { status: 500 } + ); + } +} \ No newline at end of file