- res.sendFile(embedPath, { maxAge: 0 })
- }
-)
-clientsRouter.use(
- '/videos/test-embed',
- (req: express.Request, res: express.Response) => res.sendFile(testEmbedPath)
-)
+ res.setHeader('Cache-Control', 'public, max-age=0')
+
+ next()
+ },
+
+ asyncMiddleware(generateEmbedHtmlPage)
+]
+
+clientsRouter.use('/videos/embed', ...embedMiddlewares)
+clientsRouter.use('/video-playlists/embed', ...embedMiddlewares)
+
+const testEmbedController = (req: express.Request, res: express.Response) => res.sendFile(testEmbedPath)
+
+clientsRouter.use('/videos/test-embed', testEmbedController)
+clientsRouter.use('/video-playlists/test-embed', testEmbedController)