Files
Flowise/packages/server/src/utils/getRunningExpressApp.ts
T
Karlo Benčić e8a33e4d4d fix: Error Cannot read properties of undefined (reading 'sendTelemetry') (#3734)
fix Error: Cannot read properties of undefined (reading 'sendTelemetry')
2024-12-21 01:09:45 +00:00

14 lines
452 B
TypeScript

import * as Server from '../index'
export const getRunningExpressApp = function () {
const runningExpressInstance = Server.getInstance()
if (
typeof runningExpressInstance === 'undefined' ||
typeof runningExpressInstance.nodesPool === 'undefined' ||
typeof runningExpressInstance.telemetry === 'undefined'
) {
throw new Error(`Error: getRunningExpressApp failed!`)
}
return runningExpressInstance
}