diff options
author | Chocobozzz <me@florianbigard.com> | 2020-04-10 15:07:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-04-10 15:23:25 +0200 |
commit | 5e2b2e2775421cd98286d6e2f75cf38aae7a212c (patch) | |
tree | d92e32824d83cecbe5e90206738f393b47e55754 /server/typings/plugins | |
parent | 9afa0901f11c321e071c42ba3c814a3af4843c55 (diff) | |
download | PeerTube-5e2b2e2775421cd98286d6e2f75cf38aae7a212c.tar.gz PeerTube-5e2b2e2775421cd98286d6e2f75cf38aae7a212c.tar.zst PeerTube-5e2b2e2775421cd98286d6e2f75cf38aae7a212c.zip |
Add ability for plugins to add custom routes
Diffstat (limited to 'server/typings/plugins')
-rw-r--r-- | server/typings/plugins/register-server-option.model.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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 | |||
6 | import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model' | 6 | import { PluginVideoLanguageManager } from '../../../shared/models/plugins/plugin-video-language-manager.model' |
7 | import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model' | 7 | import { PluginVideoLicenceManager } from '../../../shared/models/plugins/plugin-video-licence-manager.model' |
8 | import { Logger } from 'winston' | 8 | import { Logger } from 'winston' |
9 | import { Router } from 'express' | ||
9 | 10 | ||
10 | export type PeerTubeHelpers = { | 11 | export type PeerTubeHelpers = { |
11 | logger: Logger | 12 | logger: Logger |
@@ -32,5 +33,11 @@ export type RegisterServerOptions = { | |||
32 | videoLanguageManager: PluginVideoLanguageManager | 33 | videoLanguageManager: PluginVideoLanguageManager |
33 | videoLicenceManager: PluginVideoLicenceManager | 34 | videoLicenceManager: PluginVideoLicenceManager |
34 | 35 | ||
36 | // Get plugin router to create custom routes | ||
37 | // Base routes of this router are | ||
38 | // * /plugins/:pluginName/:pluginVersion/router/... | ||
39 | // * /plugins/:pluginName/router/... | ||
40 | getRouter(): Router | ||
41 | |||
35 | peertubeHelpers: PeerTubeHelpers | 42 | peertubeHelpers: PeerTubeHelpers |
36 | } | 43 | } |