diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-17 11:28:11 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-17 11:28:11 +0200 |
commit | 154898b0b7bc1af41fc5a94974e338a3590c90f3 (patch) | |
tree | 5fb90f66da7587aed53c99ac1884c7acd0c1f7ca /server/controllers/api/config.ts | |
parent | df98563e2104b82b119c00a3cd83cd0dc1242d25 (diff) | |
download | PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.gz PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.tar.zst PeerTube-154898b0b7bc1af41fc5a94974e338a3590c90f3.zip |
Share models between server and client
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index c63981797..3e9aa77a5 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | 2 | ||
3 | import { CONFIG } from '../../initializers' | 3 | import { CONFIG } from '../../initializers' |
4 | import { ServerConfig } from '../../../shared' | ||
4 | 5 | ||
5 | const configRouter = express.Router() | 6 | const configRouter = express.Router() |
6 | 7 | ||
@@ -8,11 +9,12 @@ configRouter.get('/', getConfig) | |||
8 | 9 | ||
9 | // Get the client credentials for the PeerTube front end | 10 | // Get the client credentials for the PeerTube front end |
10 | function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { | 11 | function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { |
11 | res.json({ | 12 | const json: ServerConfig = { |
12 | signup: { | 13 | signup: { |
13 | enabled: CONFIG.SIGNUP.ENABLED | 14 | enabled: CONFIG.SIGNUP.ENABLED |
14 | } | 15 | } |
15 | }) | 16 | } |
17 | res.json(json) | ||
16 | } | 18 | } |
17 | 19 | ||
18 | // --------------------------------------------------------------------------- | 20 | // --------------------------------------------------------------------------- |