Add basic test API without external dependencies
This commit is contained in:
parent
07f8e49924
commit
dda057c1d6
1 changed files with 22 additions and 0 deletions
22
pages/api/test-basic.js
Normal file
22
pages/api/test-basic.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
export default function handler(req, res) {
|
||||
// Set CORS headers
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
||||
res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization');
|
||||
|
||||
// Handle preflight requests
|
||||
if (req.method === 'OPTIONS') {
|
||||
res.status(200).end();
|
||||
return;
|
||||
}
|
||||
|
||||
// Simple response without any external dependencies
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
message: 'Basic API is working!',
|
||||
timestamp: new Date().toISOString(),
|
||||
method: req.method,
|
||||
url: req.url,
|
||||
headers: Object.keys(req.headers)
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue