/** * Script de test rapide du serveur */ require('dotenv').config(); const SourceFinderApp = require('./src/app'); async function testServer() { console.log('๐Ÿงช Testing SourceFinder server...'); try { const sourceFinderApp = new SourceFinderApp(); const app = await sourceFinderApp.initialize(); const server = app.listen(3000, async () => { console.log('โœ… Server started on port 3000'); // Test health endpoint try { const response = await fetch('http://localhost:3000/health'); const data = await response.json(); console.log('โœ… Health check:', data); // Test API endpoint const apiResponse = await fetch('http://localhost:3000/api/v1/news/search'); const apiData = await apiResponse.json(); console.log('โœ… API endpoint:', apiData); console.log('๐ŸŽ‰ All tests passed!'); } catch (error) { console.error('โŒ Test failed:', error.message); } server.close(); await sourceFinderApp.shutdown(); }); } catch (error) { console.error('โŒ Server test failed:', error); } } testServer();