Initial
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user