aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server.ts b/server.ts
index 6963bbf23..f2e589243 100644
--- a/server.ts
+++ b/server.ts
@@ -121,7 +121,8 @@ import { updateStreamingPlaylistsInfohashesIfNeeded } from './server/lib/hls'
121import { PluginsCheckScheduler } from './server/lib/schedulers/plugins-check-scheduler' 121import { PluginsCheckScheduler } from './server/lib/schedulers/plugins-check-scheduler'
122import { Hooks } from './server/lib/plugins/hooks' 122import { Hooks } from './server/lib/plugins/hooks'
123import { PluginManager } from './server/lib/plugins/plugin-manager' 123import { PluginManager } from './server/lib/plugins/plugin-manager'
124import { LiveManager } from '@server/lib/live-manager' 124import { LiveManager } from './server/lib/live-manager'
125import { HttpStatusCode } from './shared/core-utils/miscs/http-error-codes'
125 126
126// ----------- Command line ----------- 127// ----------- Command line -----------
127 128
@@ -210,7 +211,7 @@ if (cli.client) app.use('/', clientsRouter)
210// Catch 404 and forward to error handler 211// Catch 404 and forward to error handler
211app.use(function (req, res, next) { 212app.use(function (req, res, next) {
212 const err = new Error('Not Found') 213 const err = new Error('Not Found')
213 err['status'] = 404 214 err['status'] = HttpStatusCode.NOT_FOUND_404
214 next(err) 215 next(err)
215}) 216})
216 217
@@ -224,7 +225,7 @@ app.use(function (err, req, res, next) {
224 const sql = err.parent ? err.parent.sql : undefined 225 const sql = err.parent ? err.parent.sql : undefined
225 226
226 logger.error('Error in controller.', { err: error, sql }) 227 logger.error('Error in controller.', { err: error, sql })
227 return res.status(err.status || 500).end() 228 return res.status(err.status || HttpStatusCode.INTERNAL_SERVER_ERROR_500).end()
228}) 229})
229 230
230const server = createWebsocketTrackerServer(app) 231const server = createWebsocketTrackerServer(app)