aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts18
1 files changed, 8 insertions, 10 deletions
diff --git a/server.ts b/server.ts
index f04e993f6..385996470 100644
--- a/server.ts
+++ b/server.ts
@@ -1,11 +1,3 @@
1import { registerTSPaths } from './server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { isTestInstance } from './server/helpers/core-utils'
5if (isTestInstance()) {
6 require('source-map-support').install()
7}
8
9// ----------- Node modules ----------- 1// ----------- Node modules -----------
10import express from 'express' 2import express from 'express'
11import morgan, { token } from 'morgan' 3import morgan, { token } from 'morgan'
@@ -19,7 +11,7 @@ import { program as cli } from 'commander'
19process.title = 'peertube' 11process.title = 'peertube'
20 12
21// Create our main app 13// Create our main app
22const app = express().disable("x-powered-by") 14const app = express().disable('x-powered-by')
23 15
24// ----------- Core checker ----------- 16// ----------- Core checker -----------
25import { checkMissedConfig, checkFFmpeg, checkNodeVersion } from './server/initializers/checker-before-init' 17import { checkMissedConfig, checkFFmpeg, checkNodeVersion } from './server/initializers/checker-before-init'
@@ -41,7 +33,12 @@ checkFFmpeg(CONFIG)
41 process.exit(-1) 33 process.exit(-1)
42 }) 34 })
43 35
44checkNodeVersion() 36try {
37 checkNodeVersion()
38} catch (err) {
39 logger.error('Error in NodeJS check.', { err })
40 process.exit(-1)
41}
45 42
46import { checkConfig, checkActivityPubUrls, checkFFmpegVersion } from './server/initializers/checker-after-init' 43import { checkConfig, checkActivityPubUrls, checkFFmpegVersion } from './server/initializers/checker-after-init'
47 44
@@ -130,6 +127,7 @@ import { HttpStatusCode } from './shared/models/http/http-error-codes'
130import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache' 127import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache'
131import { ServerConfigManager } from '@server/lib/server-config-manager' 128import { ServerConfigManager } from '@server/lib/server-config-manager'
132import { VideoViews } from '@server/lib/video-views' 129import { VideoViews } from '@server/lib/video-views'
130import { isTestInstance } from './server/helpers/core-utils'
133 131
134// ----------- Command line ----------- 132// ----------- Command line -----------
135 133