// Test script to verify the signup API endpoint works // Run with: node test-api.js const fetch = require('node-fetch'); async function testSignupApi() { console.log('Testing signup API endpoint...'); try { const response = await fetch('http://localhost:3001/api/auth/signup', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ email: 'test@example.com', password: 'testpassword' }) }); console.log('Status:', response.status); console.log('Headers:', response.headers.raw()); const contentType = response.headers.get('content-type'); console.log('Content-Type:', contentType); if (contentType && contentType.includes('application/json')) { const data = await response.json(); console.log('JSON Response:', data); } else { const text = await response.text(); console.log('Non-JSON Response (likely HTML):'); console.log(text.substring(0, 500) + '...'); } } catch (error) { console.error('Error testing API:', error); } } // Run the test testSignupApi();