aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/services.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/services.ts')
-rw-r--r--server/controllers/services.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/server/controllers/services.ts b/server/controllers/services.ts
index 352d0b19a..c1c53c3fc 100644
--- a/server/controllers/services.ts
+++ b/server/controllers/services.ts
@@ -1,8 +1,7 @@
1import * as express from 'express' 1import * as express from 'express'
2import { CONFIG, EMBED_SIZE, PREVIEWS_SIZE } from '../initializers' 2import { EMBED_SIZE, PREVIEWS_SIZE, WEBSERVER } from '../initializers/constants'
3import { asyncMiddleware, oembedValidator } from '../middlewares' 3import { asyncMiddleware, oembedValidator } from '../middlewares'
4import { accountsNameWithHostGetValidator } from '../middlewares/validators' 4import { accountNameWithHostGetValidator } from '../middlewares/validators'
5import { VideoModel } from '../models/video/video'
6 5
7const servicesRouter = express.Router() 6const servicesRouter = express.Router()
8 7
@@ -11,7 +10,7 @@ servicesRouter.use('/oembed',
11 generateOEmbed 10 generateOEmbed
12) 11)
13servicesRouter.use('/redirect/accounts/:accountName', 12servicesRouter.use('/redirect/accounts/:accountName',
14 asyncMiddleware(accountsNameWithHostGetValidator), 13 asyncMiddleware(accountNameWithHostGetValidator),
15 redirectToAccountUrl 14 redirectToAccountUrl
16) 15)
17 16
@@ -23,9 +22,9 @@ export {
23 22
24// --------------------------------------------------------------------------- 23// ---------------------------------------------------------------------------
25 24
26function generateOEmbed (req: express.Request, res: express.Response, next: express.NextFunction) { 25function generateOEmbed (req: express.Request, res: express.Response) {
27 const video = res.locals.video as VideoModel 26 const video = res.locals.video
28 const webserverUrl = CONFIG.WEBSERVER.URL 27 const webserverUrl = WEBSERVER.URL
29 const maxHeight = parseInt(req.query.maxheight, 10) 28 const maxHeight = parseInt(req.query.maxheight, 10)
30 const maxWidth = parseInt(req.query.maxwidth, 10) 29 const maxWidth = parseInt(req.query.maxwidth, 10)
31 30