peertube-plugin-livechat/server/lib/diagnostic/index.ts
John Livingston b4dabfeeb9 New debug mode:
Debug mode is no more triggered by the NODE_ENV value, but by testing
the existance of a file in the plugin data directory.
2023-04-14 11:33:41 +02:00

26 lines
815 B
TypeScript

import type { RegisterServerOptions } from '@peertube/peertube-types'
import { diagBackend } from './backend'
import { TestResult, newResult } from './utils'
import { diagDebug } from './debug'
import { diagProsody } from './prosody'
import { diagVideo } from './video'
export async function diag (test: string, options: RegisterServerOptions): Promise<TestResult> {
let result: TestResult
if (test === 'backend') {
result = await diagBackend(test, options)
} else if (test === 'debug') {
result = await diagDebug(test, options)
} else if (test === 'webchat-video') {
result = await diagVideo(test, options)
} else if (test === 'prosody') {
result = await diagProsody(test, options)
} else {
result = newResult(test)
result.messages.push('Unknown test')
}
return result
}