]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server.ts
Bumped to version v3.1.0
[github/Chocobozzz/PeerTube.git] / server.ts
index 66dcb3c400cb584df8a342f245785219b4960e84..00cd87e20f525cbec2f3d5390631c3e57bd30328 100644 (file)
--- a/server.ts
+++ b/server.ts
@@ -103,7 +103,8 @@ import {
   webfingerRouter,
   trackerRouter,
   createWebsocketTrackerServer,
-  botsRouter
+  botsRouter,
+  downloadRouter
 } from './server/controllers'
 import { advertiseDoNotTrack } from './server/middlewares/dnt'
 import { Redis } from './server/lib/redis'
@@ -123,6 +124,7 @@ import { Hooks } from './server/lib/plugins/hooks'
 import { PluginManager } from './server/lib/plugins/plugin-manager'
 import { LiveManager } from './server/lib/live-manager'
 import { HttpStatusCode } from './shared/core-utils/miscs/http-error-codes'
+import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache'
 
 // ----------- Command line -----------
 
@@ -202,6 +204,7 @@ app.use('/', botsRouter)
 
 // Static files
 app.use('/', staticRouter)
+app.use('/', downloadRouter)
 app.use('/', lazyStaticRouter)
 
 // Client files, last valid routes!
@@ -258,6 +261,7 @@ async function startApplication () {
   // Caches initializations
   VideosPreviewCache.Instance.init(CONFIG.CACHE.PREVIEWS.SIZE, FILES_CACHE.PREVIEWS.MAX_AGE)
   VideosCaptionCache.Instance.init(CONFIG.CACHE.VIDEO_CAPTIONS.SIZE, FILES_CACHE.VIDEO_CAPTIONS.MAX_AGE)
+  VideosTorrentCache.Instance.init(CONFIG.CACHE.TORRENTS.SIZE, FILES_CACHE.TORRENTS.MAX_AGE)
 
   // Enable Schedulers
   ActorFollowScheduler.Instance.enable()