My-Weekly-ToDo-List/test-api.js
mARTin d92a8c7210 feat: add task actions (notes/delete) and refine animation logic
- Added 'onDelete' and 'onNotes' support to TaskItem.
- Implemented hover actions (Delete and Notes icons) for tasks.
- Added Notes Modal for editing task markdown content.
- Simplified navigation animation to remove blank flash (single-phase slide-in).
- Fixed syntax error in updateTask function.
- Updated styles for modal and task actions.
2026-02-01 12:25:53 +01:00

42 lines
1.1 KiB
JavaScript

// 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:3000/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();