diff --git a/pages/api/test-basic.js b/pages/api/test-basic.js new file mode 100644 index 0000000..c444b88 --- /dev/null +++ b/pages/api/test-basic.js @@ -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) + }); +} \ No newline at end of file