diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-19 21:34:51 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-19 21:34:51 +0200 |
commit | e861452fb26553177ad4e32bfb18b4fd8a5b1816 (patch) | |
tree | 7c0cfd464709243a452b431665f5107a973df682 /server/controllers/api/v1/clients.js | |
parent | 5c39adb7313e0696aabb4b71196ab7b0b378c359 (diff) | |
download | PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.tar.gz PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.tar.zst PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.zip |
Server: put config in constants
Diffstat (limited to 'server/controllers/api/v1/clients.js')
-rw-r--r-- | server/controllers/api/v1/clients.js | 7 |
1 files changed, 4 insertions, 3 deletions
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 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | const config = require('config') | ||
4 | const express = require('express') | 3 | const express = require('express') |
5 | const mongoose = require('mongoose') | 4 | const mongoose = require('mongoose') |
6 | 5 | ||
6 | const constants = require('../../../initializers/constants') | ||
7 | |||
7 | const Client = mongoose.model('OAuthClient') | 8 | const Client = mongoose.model('OAuthClient') |
8 | 9 | ||
9 | const router = express.Router() | 10 | const router = express.Router() |
@@ -12,8 +13,8 @@ router.get('/local', getLocalClient) | |||
12 | 13 | ||
13 | // Get the client credentials for the PeerTube front end | 14 | // Get the client credentials for the PeerTube front end |
14 | function getLocalClient (req, res, next) { | 15 | function getLocalClient (req, res, next) { |
15 | const serverHost = config.get('webserver.host') | 16 | const serverHost = constants.CONFIG.WEBSERVER.HOST |
16 | const serverPort = config.get('webserver.port') | 17 | const serverPort = constants.CONFIG.WEBSERVER.PORT |
17 | let headerHostShouldBe = serverHost | 18 | let headerHostShouldBe = serverHost |
18 | if (serverPort !== 80 && serverPort !== 443) { | 19 | if (serverPort !== 80 && serverPort !== 443) { |
19 | headerHostShouldBe += ':' + serverPort | 20 | headerHostShouldBe += ':' + serverPort |