2025-08-09 10:04:14 +08:00

30 lines
765 B
JavaScript

const fetch = require('node-fetch');
async function testAPI() {
try {
console.log('Testing register-email API...');
const response = await fetch('http://localhost:3001/api/v1/auth/register-email', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'testuser@example.com',
password: 'TestPass123',
displayName: 'Test User'
})
});
console.log('Response status:', response.status);
console.log('Response headers:', Object.fromEntries(response.headers));
const data = await response.text();
console.log('Response body:', data);
} catch (error) {
console.error('Error:', error.message);
}
}
testAPI();