aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/config.ts
blob: f02a2bc58efb2c71a677d2fb07fc1a238f98792e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import * as express from 'express'

import { isSignupAllowed } from '../../helpers'
import { ServerConfig } from '../../../shared'

const configRouter = express.Router()

configRouter.get('/', getConfig)

// Get the client credentials for the PeerTube front end
function getConfig (req: express.Request, res: express.Response, next: express.NextFunction) {

  isSignupAllowed().then(allowed => {
    const json: ServerConfig = {
      signup: {
        allowed
      }
    }
    res.json(json)
  })
}

// ---------------------------------------------------------------------------

export {
  configRouter
}