import './styles.css'; const dataContainer = document.getElementById('app'); async function fetchAndDisplayData() { try { dataContainer.textContent = 'Loading data...'; const response = await fetch('http://localhost:5557/api/data'); if (!response.ok) { console.log(`response not okay`) throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); console.log(data) // Display the data if (data.length === 0) { dataContainer.textContent = 'No data found'; return; } // Create HTML for the data const html = `
Role: ${item.role}
Email: ${item.email}
Username: ${item.username}
UUID: ${item.userId}
Initial Password: ${item.password}
Birthdate: ${new Date(item.birthdate).toDateString()}
Registered: ${new Date(item.registeredAt).toDateString()}
Created On: ${new Date(item.createdAt).toDateString()}
Updated On: ${new Date(item.updatedAt).toDateString()}
Profile Bio: ${item.profile?.bio || 'N/A'}