Spaces:
Running
Running
Update app.js
Browse files
app.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
const { chromium } = require('playwright');
|
| 2 |
const fs = require('fs');
|
| 3 |
const path = require('path');
|
|
@@ -13,6 +14,9 @@ const DOWNLOAD_DIR = 'downloads';
|
|
| 13 |
// Check every 5 minutes
|
| 14 |
const CHECK_INTERVAL = 5 * 60 * 1000;
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
// =========================
|
| 17 |
// CREATE DOWNLOAD FOLDER
|
| 18 |
// =========================
|
|
@@ -388,4 +392,20 @@ setInterval(async () => {
|
|
| 388 |
|
| 389 |
await startChecking();
|
| 390 |
|
| 391 |
-
}, CHECK_INTERVAL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const express = require('express');
|
| 2 |
const { chromium } = require('playwright');
|
| 3 |
const fs = require('fs');
|
| 4 |
const path = require('path');
|
|
|
|
| 14 |
// Check every 5 minutes
|
| 15 |
const CHECK_INTERVAL = 5 * 60 * 1000;
|
| 16 |
|
| 17 |
+
const app = express();
|
| 18 |
+
|
| 19 |
+
const PORT = process.env.PORT || 7860;
|
| 20 |
// =========================
|
| 21 |
// CREATE DOWNLOAD FOLDER
|
| 22 |
// =========================
|
|
|
|
| 392 |
|
| 393 |
await startChecking();
|
| 394 |
|
| 395 |
+
}, CHECK_INTERVAL);
|
| 396 |
+
|
| 397 |
+
// =========================
|
| 398 |
+
// EXPRESS SERVER
|
| 399 |
+
// =========================
|
| 400 |
+
|
| 401 |
+
app.get('/', (req, res) => {
|
| 402 |
+
|
| 403 |
+
res.send('JNVU Monitor Running ✅');
|
| 404 |
+
|
| 405 |
+
});
|
| 406 |
+
|
| 407 |
+
app.listen(PORT, () => {
|
| 408 |
+
|
| 409 |
+
console.log(`Server running on port ${PORT}`);
|
| 410 |
+
|
| 411 |
+
});
|