This commit is contained in:
indifferentketchup
2026-04-09 09:49:19 -05:00
parent a4fb82620a
commit 7fff9192b4
8 changed files with 115 additions and 75 deletions

View File

@@ -12,7 +12,7 @@ const ADMIN_PASSWORD = process.env.SETTINGS_ADMIN_PASSWORD;
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'public'), { index: false }));
app.use(session({
secret: SECRET || 'fallback-secret-change-me',
resave: false,
@@ -93,6 +93,10 @@ app.get('/api/restart/status', requireAuth, async (req, res) => {
catch (e) { res.status(502).json({ error: 'Bot unreachable' }); }
});
app.get('*', requireAuth, (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});
app.listen(PORT, '0.0.0.0', () => {
console.log(`[settings] running on port ${PORT}`);
});