]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/static.ts
Add upload/import/go live video attributes hooks
[github/Chocobozzz/PeerTube.git] / server / controllers / static.ts
index 912d7e36c8265b804e1d928ea83187ee33fb1891..0d94cac9b0beec4366ac7d27d99d1f7fdda6177a 100644 (file)
@@ -1,5 +1,5 @@
-import * as cors from 'cors'
-import * as express from 'express'
+import cors from 'cors'
+import express from 'express'
 import { join } from 'path'
 import { serveIndexHTML } from '@server/lib/client-html'
 import { ServerConfigManager } from '@server/lib/server-config-manager'
@@ -32,14 +32,6 @@ staticRouter.use(cors())
   Cors is very important to let other servers access torrent and video files
 */
 
-// FIXME: deprecated in 3.2, use lazy-statics instead
-// Due to historical reasons, we can't really remove this controller
-const torrentsPhysicalPath = CONFIG.STORAGE.TORRENTS_DIR
-staticRouter.use(
-  STATIC_PATHS.TORRENTS,
-  express.static(torrentsPhysicalPath, { maxAge: 0 }) // Don't cache because we could regenerate the torrent file
-)
-
 // Videos path for webseed
 staticRouter.use(
   STATIC_PATHS.WEBSEED,
@@ -69,6 +61,7 @@ staticRouter.get('/robots.txt',
   cacheRoute(ROUTE_CACHE_LIFETIME.ROBOTS),
   (_, res: express.Response) => {
     res.type('text/plain')
+
     return res.send(CONFIG.INSTANCE.ROBOTS)
   }
 )