]>
Commit | Line | Data |
---|---|---|
4d4e5cd4 | 1 | import * as express from 'express' |
65fcc311 | 2 | |
291e8d3e | 3 | import { isSignupAllowed } from '../../helpers' |
154898b0 | 4 | import { ServerConfig } from '../../../shared' |
65fcc311 C |
5 | |
6 | const configRouter = express.Router() | |
7 | ||
8 | configRouter.get('/', getConfig) | |
9 | ||
10 | // Get the client credentials for the PeerTube front end | |
69818c93 | 11 | function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) { |
291e8d3e C |
12 | |
13 | isSignupAllowed().then(allowed => { | |
14 | const json: ServerConfig = { | |
15 | signup: { | |
16 | allowed | |
17 | } | |
65fcc311 | 18 | } |
291e8d3e C |
19 | res.json(json) |
20 | }) | |
65fcc311 C |
21 | } |
22 | ||
23 | // --------------------------------------------------------------------------- | |
24 | ||
25 | export { | |
26 | configRouter | |
27 | } |