]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/static.ts
Live views update
[github/Chocobozzz/PeerTube.git] / server / controllers / static.ts
index ff77452ddb838f58b8714d43a48aa96ab795e0c8..f12f00e1bba3fcbf72ecd89a4939c66018513ce7 100644 (file)
@@ -27,6 +27,7 @@ import { getTorrentFilePath, getVideoFilePath } from '@server/lib/video-paths'
 import { getThemeOrDefault } from '../lib/plugins/theme-utils'
 import { getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config'
 import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
+import { serveIndexHTML } from '@server/lib/client-html'
 
 const staticRouter = express.Router()
 
@@ -119,6 +120,11 @@ staticRouter.get('/robots.txt',
   }
 )
 
+staticRouter.all('/teapot',
+  getCup,
+  asyncMiddleware(serveIndexHTML)
+)
+
 // security.txt service
 staticRouter.get('/security.txt',
   (_, res: express.Response) => {
@@ -391,3 +397,11 @@ function getHLSPlaylist (video: MVideoFullLight) {
 
   return Object.assign(playlist, { Video: video })
 }
+
+function getCup (req: express.Request, res: express.Response, next: express.NextFunction) {
+  res.status(HttpStatusCode.I_AM_A_TEAPOT_418)
+  res.setHeader('Accept-Additions', 'Non-Dairy;1,Sugar;1')
+  res.setHeader('Safe', 'if-sepia-awake')
+
+  return next()
+}