From e861452fb26553177ad4e32bfb18b4fd8a5b1816 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 19 Aug 2016 21:34:51 +0200 Subject: Server: put config in constants --- server/controllers/api/v1/clients.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server/controllers/api/v1/clients.js') diff --git a/server/controllers/api/v1/clients.js b/server/controllers/api/v1/clients.js index 0d222634b..5b460db2e 100644 --- a/server/controllers/api/v1/clients.js +++ b/server/controllers/api/v1/clients.js @@ -1,9 +1,10 @@ 'use strict' -const config = require('config') const express = require('express') const mongoose = require('mongoose') +const constants = require('../../../initializers/constants') + const Client = mongoose.model('OAuthClient') const router = express.Router() @@ -12,8 +13,8 @@ router.get('/local', getLocalClient) // Get the client credentials for the PeerTube front end function getLocalClient (req, res, next) { - const serverHost = config.get('webserver.host') - const serverPort = config.get('webserver.port') + const serverHost = constants.CONFIG.WEBSERVER.HOST + const serverPort = constants.CONFIG.WEBSERVER.PORT let headerHostShouldBe = serverHost if (serverPort !== 80 && serverPort !== 443) { headerHostShouldBe += ':' + serverPort -- cgit v1.2.3