From 5e2b2e2775421cd98286d6e2f75cf38aae7a212c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Apr 2020 15:07:54 +0200 Subject: Add ability for plugins to add custom routes --- server/typings/plugins/register-server-option.model.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'server/typings/plugins') diff --git a/server/typings/plugins/register-server-option.model.ts b/server/typings/plugins/register-server-option.model.ts index fda9afb11..3d6217d1b 100644 --- a/server/typings/plugins/register-server-option.model.ts +++ b/server/typings/plugins/register-server-option.model.ts @@ -6,6 +6,7 @@ import { PluginVideoCategoryManager } from '../../../shared/models/plugins/plugi import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model' import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model' import { Logger } from 'winston' +import { Router } from 'express' export type PeerTubeHelpers = { logger: Logger @@ -32,5 +33,11 @@ export type RegisterServerOptions = { videoLanguageManager: PluginVideoLanguageManager videoLicenceManager: PluginVideoLicenceManager + // Get plugin router to create custom routes + // Base routes of this router are + // * /plugins/:pluginName/:pluginVersion/router/... + // * /plugins/:pluginName/router/... + getRouter(): Router + peertubeHelpers: PeerTubeHelpers } -- cgit v1.2.3