aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/config.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index f02a2bc58..c9a051bdc 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -1,21 +1,29 @@
1import * as express from 'express' 1import * as express from 'express'
2 2
3import { isSignupAllowed } from '../../helpers' 3import { isSignupAllowed } from '../../helpers'
4import { CONFIG } from '../../initializers'
4import { ServerConfig } from '../../../shared' 5import { ServerConfig } from '../../../shared'
5 6
6const configRouter = express.Router() 7const configRouter = express.Router()
7 8
8configRouter.get('/', getConfig) 9configRouter.get('/', getConfig)
9 10
10// Get the client credentials for the PeerTube front end
11function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { 11function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) {
12 12
13 isSignupAllowed().then(allowed => { 13 isSignupAllowed().then(allowed => {
14 const enabledResolutions = Object.keys(CONFIG.TRANSCODING.RESOLUTIONS)
15 .filter(key => CONFIG.TRANSCODING.RESOLUTIONS[key] === true)
16 .map(r => parseInt(r, 10))
17
14 const json: ServerConfig = { 18 const json: ServerConfig = {
15 signup: { 19 signup: {
16 allowed 20 allowed
21 },
22 transcoding: {
23 enabledResolutions
17 } 24 }
18 } 25 }
26
19 res.json(json) 27 res.json(json)
20 }) 28 })
21} 29}