aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/v1/clients.js7
-rw-r--r--server/controllers/api/v1/videos.js5
2 files changed, 6 insertions, 6 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
3const config = require('config')
4const express = require('express') 3const express = require('express')
5const mongoose = require('mongoose') 4const mongoose = require('mongoose')
6 5
6const constants = require('../../../initializers/constants')
7
7const Client = mongoose.model('OAuthClient') 8const Client = mongoose.model('OAuthClient')
8 9
9const router = express.Router() 10const 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
14function getLocalClient (req, res, next) { 15function 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
diff --git a/server/controllers/api/v1/videos.js b/server/controllers/api/v1/videos.js
index 0a441f146..70d22f139 100644
--- a/server/controllers/api/v1/videos.js
+++ b/server/controllers/api/v1/videos.js
@@ -1,11 +1,11 @@
1'use strict' 1'use strict'
2 2
3const config = require('config')
4const express = require('express') 3const express = require('express')
5const mongoose = require('mongoose') 4const mongoose = require('mongoose')
6const multer = require('multer') 5const multer = require('multer')
7const waterfall = require('async/waterfall') 6const waterfall = require('async/waterfall')
8 7
8const constants = require('../../../initializers/constants')
9const logger = require('../../../helpers/logger') 9const logger = require('../../../helpers/logger')
10const friends = require('../../../lib/friends') 10const friends = require('../../../lib/friends')
11const middlewares = require('../../../middlewares') 11const middlewares = require('../../../middlewares')
@@ -20,13 +20,12 @@ const sort = middlewares.sort
20const utils = require('../../../helpers/utils') 20const utils = require('../../../helpers/utils')
21 21
22const router = express.Router() 22const router = express.Router()
23const uploads = config.get('storage.uploads')
24const Video = mongoose.model('Video') 23const Video = mongoose.model('Video')
25 24
26// multer configuration 25// multer configuration
27const storage = multer.diskStorage({ 26const storage = multer.diskStorage({
28 destination: function (req, file, cb) { 27 destination: function (req, file, cb) {
29 cb(null, uploads) 28 cb(null, constants.CONFIG.STORAGE.UPLOAD_DIR)
30 }, 29 },
31 30
32 filename: function (req, file, cb) { 31 filename: function (req, file, cb) {