diff options
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 10 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | 2 | ||
3 | import { isSignupAllowed } from '../../helpers' | 3 | import { isSignupAllowed } from '../../helpers' |
4 | import { CONFIG } from '../../initializers' | ||
4 | import { ServerConfig } from '../../../shared' | 5 | import { ServerConfig } from '../../../shared' |
5 | 6 | ||
6 | const configRouter = express.Router() | 7 | const configRouter = express.Router() |
7 | 8 | ||
8 | configRouter.get('/', getConfig) | 9 | configRouter.get('/', getConfig) |
9 | 10 | ||
10 | // Get the client credentials for the PeerTube front end | ||
11 | function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { | 11 | function 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 | } |