This commit is contained in:
2026-06-25 22:24:10 -05:00
parent 12e97e3020
commit d27811254d
13 changed files with 1368 additions and 15 deletions

View File

@@ -11,6 +11,7 @@ import { startCatalogWorker } from './services/catalogWorker.js';
import { startPromotionWorker } from './services/promotionWorker.js';
import { startHostGroupWorker } from './services/hostGroupWorker.js';
import { startRunPlanScheduleWorker } from './services/runPlanScheduleWorker.js';
import { mountRdpGateway, startRdpGateway } from './services/rdpGatewayService.js';
// Fail fast in production rather than ship with well-known default secrets.
// These defaults are fine for local development but are publicly known, so a
@@ -55,14 +56,16 @@ app.use(cors({
app.use(express.json({ limit: config.jsonLimit }));
app.use(requestLogger);
app.use('/api', apiRoutes);
mountRdpGateway(app);
app.use((error, req, res, next) => {
logger.error('unhandled error', { error });
res.status(500).json({ error: 'Unexpected server error' });
});
app.listen(config.port, () => {
const httpServer = app.listen(config.port, () => {
logger.info(`POSHManager API listening on ${config.port}`);
startRdpGateway(httpServer);
startCatalogWorker();
startPromotionWorker();
startHostGroupWorker();