diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-22 11:54:17 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-22 11:54:24 +0100 |
commit | 93df58cc4865af9046d2b31e03fa37d3ae54e45b (patch) | |
tree | 5bc454daf9cae2d4996d8503a5a7f24bf7aa3bbe /server | |
parent | 41df592101dfc4760f8710b88836ef8908ca741c (diff) | |
download | PeerTube-93df58cc4865af9046d2b31e03fa37d3ae54e45b.tar.gz PeerTube-93df58cc4865af9046d2b31e03fa37d3ae54e45b.tar.zst PeerTube-93df58cc4865af9046d2b31e03fa37d3ae54e45b.zip |
Fix service worker registration
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/client.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index f07e421b4..f5124c55b 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -12,6 +12,7 @@ const clientsRouter = express.Router() | |||
12 | const distPath = join(root(), 'client', 'dist') | 12 | const distPath = join(root(), 'client', 'dist') |
13 | const assetsImagesPath = join(root(), 'client', 'dist', 'client', 'assets', 'images') | 13 | const assetsImagesPath = join(root(), 'client', 'dist', 'client', 'assets', 'images') |
14 | const manifestPath = join(root(), 'client', 'dist', 'manifest.json') | 14 | const manifestPath = join(root(), 'client', 'dist', 'manifest.json') |
15 | const serviceWorkerPath = join(root(), 'client', 'dist', 'ngsw-worker.js') | ||
15 | const embedPath = join(distPath, 'standalone', 'videos', 'embed.html') | 16 | const embedPath = join(distPath, 'standalone', 'videos', 'embed.html') |
16 | const indexPath = join(distPath, 'index.html') | 17 | const indexPath = join(distPath, 'index.html') |
17 | 18 | ||
@@ -27,6 +28,7 @@ clientsRouter.use('/videos/embed', (req: express.Request, res: express.Response, | |||
27 | 28 | ||
28 | // Static HTML/CSS/JS client files | 29 | // Static HTML/CSS/JS client files |
29 | clientsRouter.use('/manifest.json', express.static(manifestPath, { maxAge: STATIC_MAX_AGE })) | 30 | clientsRouter.use('/manifest.json', express.static(manifestPath, { maxAge: STATIC_MAX_AGE })) |
31 | clientsRouter.use('/ngsw-worker.js', express.static(serviceWorkerPath, { maxAge: STATIC_MAX_AGE })) | ||
30 | clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE })) | 32 | clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE })) |
31 | clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE })) | 33 | clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE })) |
32 | 34 | ||