From 8d2be0ed7bb87283a1ec98609df6b82d83db706a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 11 Jul 2019 17:23:24 +0200 Subject: WIP plugins: move plugin CLI in peertube script Install/uninstall/list plugins remotely --- server/controllers/themes.ts | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 server/controllers/themes.ts (limited to 'server/controllers/themes.ts') diff --git a/server/controllers/themes.ts b/server/controllers/themes.ts deleted file mode 100644 index 104c285ad..000000000 --- a/server/controllers/themes.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as express from 'express' -import { join } from 'path' -import { RegisteredPlugin } from '../lib/plugins/plugin-manager' -import { serveThemeCSSValidator } from '../middlewares/validators/themes' - -const themesRouter = express.Router() - -themesRouter.get('/:themeName/:themeVersion/css/:staticEndpoint(*)', - serveThemeCSSValidator, - serveThemeCSSDirectory -) - -// --------------------------------------------------------------------------- - -export { - themesRouter -} - -// --------------------------------------------------------------------------- - -function serveThemeCSSDirectory (req: express.Request, res: express.Response) { - const plugin: RegisteredPlugin = res.locals.registeredPlugin - const staticEndpoint = req.params.staticEndpoint - - if (plugin.css.includes(staticEndpoint) === false) { - return res.sendStatus(404) - } - - return res.sendFile(join(plugin.path, staticEndpoint)) -} -- cgit v1.2.3