aboutsummaryrefslogtreecommitdiffhomepage
path: root/initializers/checker.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-01-31 11:23:52 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-01-31 11:23:52 +0100
commitc45f7f84001c2731909db04dd82e1c1f290386eb (patch)
treeb7e57420a1f65dfbbacc1a532bf489c9bea6125d /initializers/checker.js
parentcda021079ff455cc0fd0eb95a5395fa808ab63d1 (diff)
downloadPeerTube-c45f7f84001c2731909db04dd82e1c1f290386eb.tar.gz
PeerTube-c45f7f84001c2731909db04dd82e1c1f290386eb.tar.zst
PeerTube-c45f7f84001c2731909db04dd82e1c1f290386eb.zip
Infile code reorganization
Diffstat (limited to 'initializers/checker.js')
-rw-r--r--initializers/checker.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/initializers/checker.js b/initializers/checker.js
index 7a3a53616..7a09c02d1 100644
--- a/initializers/checker.js
+++ b/initializers/checker.js
@@ -4,10 +4,13 @@
4 var config = require('config') 4 var config = require('config')
5 var mkdirp = require('mkdirp') 5 var mkdirp = require('mkdirp')
6 6
7 var checker = {} 7 var checker = {
8 checkConfig: checkConfig,
9 createDirectoriesIfNotExist: createDirectoriesIfNotExist
10 }
8 11
9 // Check the config files 12 // Check the config files
10 checker.checkConfig = function () { 13 function checkConfig () {
11 var required = [ 'listen.port', 14 var required = [ 'listen.port',
12 'webserver.https', 'webserver.host', 'webserver.port', 15 'webserver.https', 'webserver.host', 'webserver.port',
13 'database.host', 'database.port', 'database.suffix', 16 'database.host', 'database.port', 'database.suffix',
@@ -25,7 +28,7 @@
25 } 28 }
26 29
27 // Create directories for the storage if it doesn't exist 30 // Create directories for the storage if it doesn't exist
28 checker.createDirectoriesIfNotExist = function () { 31 function createDirectoriesIfNotExist () {
29 var storages = config.get('storage') 32 var storages = config.get('storage')
30 33
31 for (var key of Object.keys(storages)) { 34 for (var key of Object.keys(storages)) {
@@ -40,6 +43,7 @@
40 } 43 }
41 } 44 }
42 45
43 // ----------- Export ----------- 46 // ---------------------------------------------------------------------------
47
44 module.exports = checker 48 module.exports = checker
45})() 49})()