Create index.js
Browse files
index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const express = require('express');
|
| 2 |
+
const app = express();
|
| 3 |
+
const port = process.env.PORT || 7860; // Render ko yahi port batana hoga
|
| 4 |
+
|
| 5 |
+
app.get('/', (req, res) => {
|
| 6 |
+
res.send('✅ TraffMonetizer + Express Running');
|
| 7 |
+
});
|
| 8 |
+
|
| 9 |
+
app.get('/health', (req, res) => {
|
| 10 |
+
res.json({ status: 'healthy', time: new Date().toISOString() });
|
| 11 |
+
});
|
| 12 |
+
|
| 13 |
+
// ❗ ZAROORI: Listen on 0.0.0.0, not localhost or 127.0.0.1
|
| 14 |
+
const server = app.listen(port, '0.0.0.0', () => {
|
| 15 |
+
console.log(`✅✅✅ SERVER STARTED on port ${port}`);
|
| 16 |
+
});
|