Update server.js
Browse files
server.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
| 1 |
const express = require('express');
|
| 2 |
const app = express();
|
| 3 |
-
const
|
|
|
|
|
|
|
| 4 |
|
| 5 |
app.get('/', (req, res) => {
|
| 6 |
-
|
|
|
|
| 7 |
});
|
| 8 |
|
| 9 |
-
app.listen(
|
| 10 |
-
|
| 11 |
});
|
|
|
|
| 1 |
const express = require('express');
|
| 2 |
const app = express();
|
| 3 |
+
const PORT = process.env.PORT || 7860;
|
| 4 |
+
|
| 5 |
+
const startTime = Date.now();
|
| 6 |
|
| 7 |
app.get('/', (req, res) => {
|
| 8 |
+
const uptimeSeconds = Math.floor((Date.now() - startTime) / 1000);
|
| 9 |
+
res.send(`I'm (from node yaaaa) alive for: ${uptimeSeconds} seconds`);
|
| 10 |
});
|
| 11 |
|
| 12 |
+
app.listen(PORT, '0.0.0.0', () => {
|
| 13 |
+
console.log(`✅ Server running on http://0.0.0.0:${PORT}`);
|
| 14 |
});
|