]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server.js
Create a constants module to easily modify some constants in a test
[github/Chocobozzz/PeerTube.git] / server.js
index 4b93a7adf939e0ca7245d407051b450e7ff2becf..ad57649b24eaafb75889634a6bae258e0e6dc67a 100644 (file)
--- a/server.js
+++ b/server.js
 
   checker.createDirectoriesIfNotExist()
 
-  // ----------- Constants -----------
-  var utils = require('./src/utils')
-
-  global.API_VERSION = 'v1'
-  global.FRIEND_BASE_SCORE = utils.isTestInstance() ? 20 : 100
-
   // ----------- PeerTube modules -----------
   var config = require('config')
+  var constants = require('./src/constants')
   var customValidators = require('./src/customValidators')
   var logger = require('./src/logger')
   var poolRequests = require('./src/poolRequests')
   var routes = require('./routes')
+  var utils = require('./src/utils')
   var videos = require('./src/videos')
   var webtorrent = require('./src/webTorrentNode')
 
@@ -76,7 +72,7 @@
   app.set('view engine', 'jade')
 
   // API routes
-  var api_route = '/api/' + global.API_VERSION
+  var api_route = '/api/' + constants.API_VERSION
   app.use(api_route, routes.api)
 
   // Views routes