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