aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts11
1 files changed, 2 insertions, 9 deletions
diff --git a/server.ts b/server.ts
index 80bf118c0..3f2d27718 100644
--- a/server.ts
+++ b/server.ts
@@ -7,16 +7,14 @@ if (isTestInstance()) {
7// ----------- Node modules ----------- 7// ----------- Node modules -----------
8import * as bodyParser from 'body-parser' 8import * as bodyParser from 'body-parser'
9import * as express from 'express' 9import * as express from 'express'
10// FIXME: cannot import express-validator
11const expressValidator = require('express-validator')
12import * as http from 'http' 10import * as http from 'http'
13import * as morgan from 'morgan' 11import * as morgan from 'morgan'
14import * as path from 'path' 12import * as path from 'path'
15import * as bittorrentTracker from 'bittorrent-tracker' 13import * as bitTorrentTracker from 'bittorrent-tracker'
16import * as cors from 'cors' 14import * as cors from 'cors'
17import { Server as WebSocketServer } from 'ws' 15import { Server as WebSocketServer } from 'ws'
18 16
19const TrackerServer = bittorrentTracker.Server 17const TrackerServer = bitTorrentTracker.Server
20 18
21process.title = 'peertube' 19process.title = 'peertube'
22 20
@@ -49,7 +47,6 @@ db.init(false).then(() => onDatabaseInitDone())
49// ----------- PeerTube modules ----------- 47// ----------- PeerTube modules -----------
50import { migrate, installApplication } from './server/initializers' 48import { migrate, installApplication } from './server/initializers'
51import { JobScheduler, activateSchedulers, VideosPreviewCache } from './server/lib' 49import { JobScheduler, activateSchedulers, VideosPreviewCache } from './server/lib'
52import * as customValidators from './server/helpers/custom-validators'
53import { apiRouter, clientsRouter, staticRouter } from './server/controllers' 50import { apiRouter, clientsRouter, staticRouter } from './server/controllers'
54 51
55// ----------- Command line ----------- 52// ----------- Command line -----------
@@ -81,10 +78,6 @@ app.use(morgan('combined', {
81// For body requests 78// For body requests
82app.use(bodyParser.json({ limit: '500kb' })) 79app.use(bodyParser.json({ limit: '500kb' }))
83app.use(bodyParser.urlencoded({ extended: false })) 80app.use(bodyParser.urlencoded({ extended: false }))
84// Validate some params for the API
85app.use(expressValidator({
86 customValidators: customValidators
87}))
88 81
89// ----------- Views, routes and static files ----------- 82// ----------- Views, routes and static files -----------
90 83