1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add service worker

This commit is contained in:
Chocobozzz 2018-02-08 17:31:05 +01:00
parent 151edeee3a
commit 7193ad1044
No known key found for this signature in database
GPG key ID: 583A612D890159BE
10 changed files with 237 additions and 161 deletions

View file

@ -11,7 +11,7 @@ const clientsRouter = express.Router()
const distPath = join(root(), 'client', 'dist')
const assetsImagesPath = join(root(), 'client', 'dist', 'client', 'assets', 'images')
const manifestPath = join(root(), 'client', 'dist', 'client', 'manifest.json')
const manifestPath = join(root(), 'client', 'dist', 'manifest.json')
const embedPath = join(distPath, 'standalone', 'videos', 'embed.html')
const indexPath = join(distPath, 'index.html')
@ -26,8 +26,8 @@ clientsRouter.use('/videos/embed', (req: express.Request, res: express.Response,
})
// Static HTML/CSS/JS client files
clientsRouter.use('/manifest.json', express.static(manifestPath, { maxAge: STATIC_MAX_AGE }))
clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE }))
clientsRouter.use('/client/manifest.json', express.static(manifestPath, { maxAge: STATIC_MAX_AGE }))
clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE }))
// 404 for static files not found