From 0ca5237139cc24797a91df09d82bab788d4cf160 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 17 Jun 2018 16:47:37 +0900 Subject: [PATCH] Send servicewroker script --- src/server/web/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 5ce040d083..d38d9165d4 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -66,9 +66,11 @@ router.get('/apple-touch-icon.png', async ctx => { }); // ServiceWroker -//router.get(/^\/sw\.(.+?)\.js$/, async ctx => { -// await send(ctx, `${client}/assets/sw.${ctx.params[0]}.js`); -//}); +router.get(/^\/sw\.(.+?)\.js$/, async ctx => { + await send(ctx, `/assets/sw.${ctx.params[0]}.js`, { + root: client + }); +}); // Manifest router.get('/manifest.json', async ctx => {