]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/controllers/api/config.ts
Add ability to limit user registrations
[github/Chocobozzz/PeerTube.git] / server / controllers / api / config.ts
1 import * as express from 'express'
2
3 import { isSignupAllowed } from '../../helpers'
4 import { ServerConfig } from '../../../shared'
5
6 const configRouter = express.Router()
7
8 configRouter.get('/', getConfig)
9
10 // Get the client credentials for the PeerTube front end
11 function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) {
12
13 isSignupAllowed().then(allowed => {
14 const json: ServerConfig = {
15 signup: {
16 allowed
17 }
18 }
19 res.json(json)
20 })
21 }
22
23 // ---------------------------------------------------------------------------
24
25 export {
26 configRouter
27 }