- Add systemd service discovery to backend - Add Proxmox LXC/VM detection - Add hostType field to config for better host categorization - Fix SSH trust between hosts (ubuntu/grizzley -> truenas/proxmox) - Add SSH terminal support via xterm.js - Add filebrowser for browsing host filesystems - Update frontend types and components for new node types
41 lines
1004 B
TypeScript
41 lines
1004 B
TypeScript
import express from 'express';
|
|
import cors from 'cors';
|
|
import discoverRouter from './routes/discover';
|
|
import configRouter from './routes/config';
|
|
import statsRouter from './routes/stats';
|
|
import filesRouter from './routes/files';
|
|
import terminalRouter from './routes/terminal';
|
|
import { getHostConfigs } from './config';
|
|
|
|
const app = express();
|
|
const PORT = 3001;
|
|
|
|
// CORS middleware for frontend communication
|
|
app.use(cors({
|
|
origin: 'http://localhost:3000',
|
|
credentials: true,
|
|
}));
|
|
|
|
app.use(express.json());
|
|
|
|
// Health check endpoint
|
|
app.get('/api/health', (req, res) => {
|
|
res.json({ status: 'ok' });
|
|
});
|
|
|
|
// Debug endpoint to check config
|
|
app.get('/api/debug-config', (req, res) => {
|
|
const hosts = getHostConfigs();
|
|
res.json({ hosts });
|
|
});
|
|
|
|
app.use('/api', discoverRouter);
|
|
app.use('/api', configRouter);
|
|
app.use('/api', statsRouter);
|
|
app.use('/api', filesRouter);
|
|
app.use('/api', terminalRouter);
|
|
|
|
app.listen(PORT, () => {
|
|
console.log(`Server running on http://localhost:${PORT}`);
|
|
});
|