Add simple test API to isolate the issue
This commit is contained in:
parent
16228f8fa0
commit
09bb380da6
1 changed files with 35 additions and 0 deletions
35
api/test.js
Normal file
35
api/test.js
Normal 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 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue