]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/client.ts
Add confirm when admin use custom js/css
[github/Chocobozzz/PeerTube.git] / server / controllers / client.ts
index c85bd8a5ed79c94d880cd260837a2f5e18287169..df2eee9c987278711ffc3f1f1ce85668441a390b 100644 (file)
@@ -10,7 +10,7 @@ import { VideoModel } from '../models/video/video'
 const clientsRouter = express.Router()
 
 const distPath = join(root(), 'client', 'dist')
-const assetsImagesPath = join(root(), 'client', 'dist', 'client', 'assets', 'images')
+const assetsImagesPath = join(root(), 'client', 'dist', 'assets', 'images')
 const embedPath = join(distPath, 'standalone', 'videos', 'embed.html')
 const indexPath = join(distPath, 'index.html')
 
@@ -25,6 +25,17 @@ clientsRouter.use('/videos/embed', (req: express.Request, res: express.Response,
 })
 
 // Static HTML/CSS/JS client files
+
+const staticClientFiles = [
+  'manifest.json',
+  'ngsw-worker.js',
+  'ngsw.json'
+]
+for (const staticClientFile of staticClientFiles) {
+  const path = join(root(), 'client', 'dist', staticClientFile)
+  clientsRouter.use('/' + staticClientFile, express.static(path, { maxAge: STATIC_MAX_AGE }))
+}
+
 clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE }))
 clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE }))