const express = require('express'); const path = require('path'); const app = express(); const PORT = process.env.PORT || 3000; // Serve static files app.use(express.static(path.join(__dirname, 'public'))); // API endpoints for dashboard data app.get('/api/dashboard', (req, res) => { const timeframe = req.query.timeframe || '30d'; const data = { topCategories: [ { name: 'AI Development', value: 32 }, { name: 'Scientific Research', value: 24 }, { name: 'Business Strategy', value: 18 }, { name: 'Creative Arts', value: 12 }, { name: 'Technical Solutions', value: 9 }, { name: 'Other', value: 5 } ], revenueOpportunities: [ { name: 'AI Consulting Services', value: 1200000 }, { name: 'Premium API Access', value: 850000 }, { name: 'Custom Model Training', value: 1800000 }, { name: 'Enterprise Solutions', value: 2500000 } ] }; res.json(data); }); // Handle SPA routing app.get('*', (req, res) => { res.sendFile(path.join(__dirname, 'public', 'index.html')); }); app.listen(PORT, () => { console.log(`Server running on port ${PORT}`); });