aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/server.ts b/server.ts
index 56a4a0c44..f6794b897 100644
--- a/server.ts
+++ b/server.ts
@@ -27,13 +27,21 @@ const app = express()
27// ----------- Core checker ----------- 27// ----------- Core checker -----------
28import { checkMissedConfig, checkFFmpeg, checkConfig } from './server/initializers/checker' 28import { checkMissedConfig, checkFFmpeg, checkConfig } from './server/initializers/checker'
29 29
30// Do not use barrels because we don't want to load all modules here (we need to initialize database first)
31import { logger } from './server/helpers/logger'
32import { ACCEPT_HEADERS, API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants'
33
30const missed = checkMissedConfig() 34const missed = checkMissedConfig()
31if (missed.length !== 0) { 35if (missed.length !== 0) {
32 throw new Error('Your configuration files miss keys: ' + missed) 36 logger.error('Your configuration files miss keys: ' + missed)
37 process.exit(-1)
33} 38}
34 39
35import { ACCEPT_HEADERS, API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants'
36checkFFmpeg(CONFIG) 40checkFFmpeg(CONFIG)
41 .catch(err => {
42 logger.error('Error in ffmpeg check.', { err })
43 process.exit(-1)
44 })
37 45
38const errorMessage = checkConfig() 46const errorMessage = checkConfig()
39if (errorMessage !== null) { 47if (errorMessage !== null) {
@@ -41,8 +49,6 @@ if (errorMessage !== null) {
41} 49}
42 50
43// ----------- Database ----------- 51// ----------- Database -----------
44// Do not use barrels because we don't want to load all modules here (we need to initialize database first)
45import { logger } from './server/helpers/logger'
46 52
47// Initialize database and models 53// Initialize database and models
48import { initDatabaseModels } from './server/initializers/database' 54import { initDatabaseModels } from './server/initializers/database'