aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts23
1 files changed, 12 insertions, 11 deletions
diff --git a/server.ts b/server.ts
index 9c74ddb69..80bf118c0 100644
--- a/server.ts
+++ b/server.ts
@@ -23,28 +23,29 @@ process.title = 'peertube'
23// Create our main app 23// Create our main app
24const app = express() 24const app = express()
25 25
26// ----------- Database ----------- 26// ----------- Core checker -----------
27// Do not use barrels because we don't want to load all modules here (we need to initialize database first)
28import { logger } from './server/helpers/logger'
29import { API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants'
30// Initialize database and models
31import { database as db } from './server/initializers/database'
32db.init(false).then(() => onDatabaseInitDone())
33
34// ----------- Checker -----------
35import { checkMissedConfig, checkFFmpeg, checkConfig } from './server/initializers/checker' 27import { checkMissedConfig, checkFFmpeg, checkConfig } from './server/initializers/checker'
36 28
37const missed = checkMissedConfig() 29const missed = checkMissedConfig()
38if (missed.length !== 0) { 30if (missed.length !== 0) {
39 throw new Error('Miss some configurations keys : ' + missed) 31 throw new Error('Your configuration files miss keys: ' + missed)
40} 32}
41checkFFmpeg() 33
34import { API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants'
35checkFFmpeg(CONFIG)
42 36
43const errorMessage = checkConfig() 37const errorMessage = checkConfig()
44if (errorMessage !== null) { 38if (errorMessage !== null) {
45 throw new Error(errorMessage) 39 throw new Error(errorMessage)
46} 40}
47 41
42// ----------- Database -----------
43// Do not use barrels because we don't want to load all modules here (we need to initialize database first)
44import { logger } from './server/helpers/logger'
45// Initialize database and models
46import { database as db } from './server/initializers/database'
47db.init(false).then(() => onDatabaseInitDone())
48
48// ----------- PeerTube modules ----------- 49// ----------- PeerTube modules -----------
49import { migrate, installApplication } from './server/initializers' 50import { migrate, installApplication } from './server/initializers'
50import { JobScheduler, activateSchedulers, VideosPreviewCache } from './server/lib' 51import { JobScheduler, activateSchedulers, VideosPreviewCache } from './server/lib'