35 lines
No EOL
893 B
JavaScript
35 lines
No EOL
893 B
JavaScript
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 }
|
|
);
|
|
}
|
|
}
|