import express from 'express'; import cors from 'cors'; const app = express(); const PORT = 3001; // CORS middleware for frontend communication app.use(cors({ origin: 'http://localhost:3000', credentials: true, })); // Health check endpoint app.get('/api/health', (req, res) => { res.json({ status: 'ok' }); }); app.listen(PORT, () => { console.log(`Server running on http://localhost:${PORT}`); });