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:
@ -11,7 +11,7 @@ async function initSettingsRouter (options: RegisterServerOptions): Promise<Rout
|
||||
router.get('/diagnostic', asyncMiddleware(
|
||||
async (req: Request, res: Response, _next: NextFunction) => {
|
||||
logger.info('Accessing peertube-plugin-livechat diagnostic tool.')
|
||||
const src = getBaseStaticRoute() + 'settings/settings.js'
|
||||
const src = getBaseStaticRoute(options) + 'settings/settings.js'
|
||||
res.status(200)
|
||||
res.type('html')
|
||||
res.send('<html><body><div>Loading...</div></body><script src="' + src + '"></script></html>')
|
||||
|
@ -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']) {
|
||||
|
Reference in New Issue
Block a user