]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/well-known.ts
feat: show contained playlists under My videos (#5125)
[github/Chocobozzz/PeerTube.git] / server / controllers / well-known.ts
index f467bd629835e2299b922b8d7a6c6a14899b0f35..ce5883571cf66e1f7961f9f08f53c57b9e322fe5 100644 (file)
@@ -5,6 +5,7 @@ import { root } from '@shared/core-utils'
 import { CONFIG } from '../initializers/config'
 import { ROUTE_CACHE_LIFETIME, WEBSERVER } from '../initializers/constants'
 import { cacheRoute } from '../middlewares/cache/cache'
+import { handleStaticError } from '@server/middlewares'
 
 const wellKnownRouter = express.Router()
 
@@ -69,6 +70,12 @@ wellKnownRouter.use('/.well-known/host-meta',
   }
 )
 
+wellKnownRouter.use('/.well-known/',
+  cacheRoute(ROUTE_CACHE_LIFETIME.WELL_KNOWN),
+  express.static(CONFIG.STORAGE.WELL_KNOWN_DIR, { fallthrough: false }),
+  handleStaticError
+)
+
 // ---------------------------------------------------------------------------
 
 export {