chore: switch to TEST mode and add environment indicator
This commit is contained in:
+28
-2
@@ -955,9 +955,35 @@
|
||||
</script>
|
||||
|
||||
<!-- Version Info -->
|
||||
<div class="fixed bottom-4 right-4 text-xs text-gray-400">
|
||||
v1.0.0-beta3
|
||||
<div class="fixed bottom-4 right-4 text-xs text-gray-400 flex items-center gap-2">
|
||||
<span id="env-badge" class="hidden px-1.5 py-0.5 rounded-sm font-semibold uppercase tracking-wider text-[10px]"></span>
|
||||
<span id="version-text">v1.0.0-beta3</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Fetch environment info
|
||||
async function updateEnvBadge() {
|
||||
try {
|
||||
const response = await fetch('/api/config');
|
||||
if (!response.ok) return;
|
||||
const data = await response.json();
|
||||
const badge = document.getElementById('env-badge');
|
||||
|
||||
if (data.mode === 'PROD') {
|
||||
badge.textContent = 'PROD';
|
||||
badge.className = 'px-1.5 py-0.5 rounded-sm font-bold uppercase tracking-wider text-[10px] bg-green-600 text-white';
|
||||
badge.classList.remove('hidden');
|
||||
} else if (data.mode === 'TEST') {
|
||||
badge.textContent = 'TEST';
|
||||
badge.className = 'px-1.5 py-0.5 rounded-sm font-bold uppercase tracking-wider text-[10px] bg-amber-500 text-white';
|
||||
badge.classList.remove('hidden');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch config:', err);
|
||||
}
|
||||
}
|
||||
updateEnvBadge();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -40,6 +40,14 @@ console.log(' Excel Table: ' + activeConfig.excelTable);
|
||||
console.log('*'.repeat(60) + '\n');
|
||||
|
||||
const app = new Hono();
|
||||
// Environment config endpoint
|
||||
app.get('/api/config', (c) => {
|
||||
return c.json({
|
||||
mode: MODE,
|
||||
description: activeConfig.description
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// ERROR LOGGING
|
||||
@@ -1178,6 +1186,9 @@ app.post('/api/test-teams-webhook', async (c) => {
|
||||
return c.json({ success: ok, status: resp.status, body: text });
|
||||
});
|
||||
|
||||
// Serve static files from frontend directory
|
||||
app.use('/*', serveStatic({ root: './frontend' }));
|
||||
|
||||
const PORT = Number(process.env.PORT || 3020);
|
||||
|
||||
console.log(`Job Creation with Excel Sync server running at http://localhost:${PORT}`);
|
||||
|
||||
Reference in New Issue
Block a user