incognitolm commited on
Commit ·
453935d
1
Parent(s): a330fcd
Update index.js
Browse files- server/index.js +0 -3
server/index.js
CHANGED
|
@@ -27,7 +27,6 @@ const app = express();
|
|
| 27 |
const GITHUB_REPO = 'incognitolm/InferencePort-Pages';
|
| 28 |
const CDN_BASE = `https://cdn.jsdelivr.net/gh/${GITHUB_REPO}`;
|
| 29 |
let latestSHA = null;
|
| 30 |
-
const AUTO_REFRESH_INTERVAL = 60 * 1000; // 1 minute
|
| 31 |
const ADMIN_TOKEN = process.env.ADMIN_TOKEN || 'supersecret';
|
| 32 |
|
| 33 |
// Rate limiter for admin endpoints (5 attempts per IP per minute)
|
|
@@ -89,8 +88,6 @@ async function fetchLatestSHA(){
|
|
| 89 |
console.log('Updated latest SHA:', latestSHA);
|
| 90 |
}catch(e){ console.error('Failed to fetch latest commit SHA', e);}
|
| 91 |
}
|
| 92 |
-
fetchLatestSHA();
|
| 93 |
-
setInterval(fetchLatestSHA,AUTO_REFRESH_INTERVAL);
|
| 94 |
|
| 95 |
// --- Admin endpoints ---
|
| 96 |
app.get('/admin.html', async (req, res) => {
|
|
|
|
| 27 |
const GITHUB_REPO = 'incognitolm/InferencePort-Pages';
|
| 28 |
const CDN_BASE = `https://cdn.jsdelivr.net/gh/${GITHUB_REPO}`;
|
| 29 |
let latestSHA = null;
|
|
|
|
| 30 |
const ADMIN_TOKEN = process.env.ADMIN_TOKEN || 'supersecret';
|
| 31 |
|
| 32 |
// Rate limiter for admin endpoints (5 attempts per IP per minute)
|
|
|
|
| 88 |
console.log('Updated latest SHA:', latestSHA);
|
| 89 |
}catch(e){ console.error('Failed to fetch latest commit SHA', e);}
|
| 90 |
}
|
|
|
|
|
|
|
| 91 |
|
| 92 |
// --- Admin endpoints ---
|
| 93 |
app.get('/admin.html', async (req, res) => {
|