Use peertubeHelpers.plugin methods when available:

* getBaseStaticRoute use peertubeHelper when available
* getBaseRouter renamed getBaseRouterRoute and use peertubeHelper when available
* Backward compatibility is maintained.
This commit is contained in:
John Livingston
2021-05-18 18:06:11 +02:00
parent 4cf9ab51aa
commit 2a8df1dc3c
6 changed files with 27 additions and 15 deletions

View File

@ -1,6 +1,6 @@
import type { Router, RequestHandler, Request, Response, NextFunction } from 'express'
import type { ProxyOptions } from 'express-http-proxy'
import { getBaseRouter } from '../helpers'
import { getBaseRouterRoute } from '../helpers'
import { asyncMiddleware } from '../middlewares/async'
import { getProsodyDomain } from '../prosody/config/domain'
import * as path from 'path'
@ -41,10 +41,10 @@ async function initWebchatRouter (options: RegisterServerOptions): Promise<Route
const prosodyDomain = await getProsodyDomain(options)
server = 'anon.' + prosodyDomain
room = '{{VIDEO_UUID}}@room.' + prosodyDomain
boshUri = getBaseRouter() + 'webchat/http-bind'
boshUri = getBaseRouterRoute(options) + 'webchat/http-bind'
wsUri = ''
authenticationUrl = options.peertubeHelpers.config.getWebserverUrl() +
getBaseRouter() +
getBaseRouterRoute(options) +
'api/auth'
advancedControls = true
} else if (settings['chat-use-builtin']) {