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 | |
parent | 41df592101dfc4760f8710b88836ef8908ca741c (diff) | |
download | PeerTube-93df58cc4865af9046d2b31e03fa37d3ae54e45b.tar.gz PeerTube-93df58cc4865af9046d2b31e03fa37d3ae54e45b.tar.zst PeerTube-93df58cc4865af9046d2b31e03fa37d3ae54e45b.zip |
Fix service worker registration
-rw-r--r-- | client/.angular-cli.json | 7 | ||||
-rw-r--r-- | client/src/environments/environment.ts | 1 | ||||
-rw-r--r-- | client/src/index.html | 2 | ||||
-rw-r--r-- | client/src/manifest.json | 4 | ||||
-rw-r--r-- | server/controllers/client.ts | 2 |
5 files changed, 7 insertions, 9 deletions
diff --git a/client/.angular-cli.json b/client/.angular-cli.json index 3bdc50492..643e1b319 100644 --- a/client/.angular-cli.json +++ b/client/.angular-cli.json | |||
@@ -14,12 +14,7 @@ | |||
14 | "output": "./client/assets/images", | 14 | "output": "./client/assets/images", |
15 | "allowOutsideOutDir": false | 15 | "allowOutsideOutDir": false |
16 | }, | 16 | }, |
17 | { | 17 | "./manifest.json" |
18 | "glob": "", | ||
19 | "input": "./manifest.json", | ||
20 | "output": "./manifest.json", | ||
21 | "allowOutsideOutDir": false | ||
22 | } | ||
23 | ], | 18 | ], |
24 | "deployUrl": "client/", | 19 | "deployUrl": "client/", |
25 | "index": "index.html", | 20 | "index": "index.html", |
diff --git a/client/src/environments/environment.ts b/client/src/environments/environment.ts index 42b8baee8..364da6745 100644 --- a/client/src/environments/environment.ts +++ b/client/src/environments/environment.ts | |||
@@ -1,4 +1,3 @@ | |||
1 | // The file contents for the current environment will overwrite these during build. | ||
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do | 1 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do |
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. | 2 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. |
4 | // The list of which env maps to which file can be found in `.angular-cli.json`. | 3 | // The list of which env maps to which file can be found in `.angular-cli.json`. |
diff --git a/client/src/index.html b/client/src/index.html index 8ff89f6a4..a824a39e2 100644 --- a/client/src/index.html +++ b/client/src/index.html | |||
@@ -7,6 +7,8 @@ | |||
7 | <meta name="viewport" content="width=device-width, initial-scale=1"> | 7 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
8 | <meta name="description" content="PeerTube, a decentralized video streaming platform using P2P (BitTorrent) directly in the web browser" /> | 8 | <meta name="description" content="PeerTube, a decentralized video streaming platform using P2P (BitTorrent) directly in the web browser" /> |
9 | 9 | ||
10 | <meta name="theme-color" content="#fff" /> | ||
11 | |||
10 | <!-- Web Manifest file --> | 12 | <!-- Web Manifest file --> |
11 | <link rel="manifest" href="/manifest.json"> | 13 | <link rel="manifest" href="/manifest.json"> |
12 | 14 | ||
diff --git a/client/src/manifest.json b/client/src/manifest.json index 53cfa40c5..707efb973 100644 --- a/client/src/manifest.json +++ b/client/src/manifest.json | |||
@@ -1,6 +1,6 @@ | |||
1 | { | 1 | { |
2 | "background_color": "white", | 2 | "background_color": "#fff", |
3 | "theme_color": "black", | 3 | "theme_color": "#fff", |
4 | "description": "A federated video streaming platform using P2P", | 4 | "description": "A federated video streaming platform using P2P", |
5 | "display": "standalone", | 5 | "display": "standalone", |
6 | "orientation": "any", | 6 | "orientation": "any", |
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 | ||