const express = require('express');
const app = express();
const port = process.env.PORT || 7860;
// Serve static files (if you have public folder)
app.use(express.static('public'));
// Main web interface
app.get('/', (req, res) => {
res.send(`
TraffMonetizer Dashboard
🚀 TraffMonetizer Dashboard
Status: Active
Service: TraffMonetizer CLI + Express
Port: ${port}
Time: ${new Date().toLocaleString()}
This service is running TraffMonetizer in background.
`);
});
// Health endpoint
app.get('/health', (req, res) => {
res.json({
status: 'healthy',
service: 'traffmonetizer-express',
timestamp: new Date().toISOString(),
port: port
});
});
// Status endpoint
app.get('/status', (req, res) => {
res.json({
traffmonetizer: 'running',
express: 'running',
uptime: process.uptime(),
memory: process.memoryUsage()
});
});
app.listen(port, '0.0.0.0', () => {
console.log(`✅ Web interface available on port ${port}`);
console.log(`✅ TraffMonetizer running in background`);
});