Add simple test API to isolate the issue

This commit is contained in:
Randall Stillwell 2025-07-23 08:22:39 -05:00
parent 16228f8fa0
commit 09bb380da6

35
api/test.js Normal file
View file

@ -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 }
);
}
}