From e4714d7d58613f6ba0345ace1ca1aff4446befb2 Mon Sep 17 00:00:00 2001 From: Henrik Liodden Date: Mon, 30 May 2022 09:54:43 +0200 Subject: [PATCH 1/4] Upgrade vercel config --- vercel.json | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/vercel.json b/vercel.json index 73f8152ad6..ef97c2b3c1 100644 --- a/vercel.json +++ b/vercel.json @@ -1,26 +1,19 @@ { - "version": 2, - "builds": [ - { - "src": "build/public/**", - "use": "@vercel/static" - }, - { - "src": "build/server.js", - "use": "@vercel/node" - } + "rewrites": [ + { "source": "/static/(.*)", "destination": "build/public/static/$1" }, + { "source": "/(.*.(png|jpg|svg|gif))", "destination": "build/public/$1" }, + { "source": "/(.*)", "destination": "/build/server.js" } ], - "routes": [ + "headers": [ { - "src": "/static/(.*)", - "headers": { "cache-control": "s-maxage=86400" }, - "dest": "build/public/static/$1" - }, - { - "src": "/(.*.(png|jpg|svg|gif))", - "dest": "build/public/$1" - }, - { "src": "/(.*)", "dest": "/build/server.js" } + "source": "/static/(.*)", + "headers": [ + { + "key": "Cache-Control", + "value": "public, s-maxage=86400" + } + ] + } ], "env": { "NDLA_EDITORIAL_CLIENT_ID": "@ndla_editorial_client_id", From 97938b6b7adfa42f5ecc7b56d4e7eae3f5d139d4 Mon Sep 17 00:00:00 2001 From: Henrik Liodden Date: Mon, 30 May 2022 11:51:14 +0200 Subject: [PATCH 2/4] Fix regex --- .gitignore | 1 + vercel.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e54c9c02b5..4327c8ce58 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ yarn-error.log scripts/.cache/ .vscode .env +.vercel diff --git a/vercel.json b/vercel.json index ef97c2b3c1..01b41fe073 100644 --- a/vercel.json +++ b/vercel.json @@ -1,7 +1,7 @@ { "rewrites": [ { "source": "/static/(.*)", "destination": "build/public/static/$1" }, - { "source": "/(.*.(png|jpg|svg|gif))", "destination": "build/public/$1" }, + { "source": "/(.*).(png|jpg|svg|gif)", "destination": "build/public/$1" }, { "source": "/(.*)", "destination": "/build/server.js" } ], "headers": [ @@ -10,7 +10,7 @@ "headers": [ { "key": "Cache-Control", - "value": "public, s-maxage=86400" + "value": "s-maxage=86400" } ] } From 427d6f6de1d0654b8bdc93772528adeb510da271 Mon Sep 17 00:00:00 2001 From: Henrik Liodden Date: Mon, 30 May 2022 13:09:59 +0200 Subject: [PATCH 3/4] Revert back from functions to builds --- vercel.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vercel.json b/vercel.json index 01b41fe073..8208b9356c 100644 --- a/vercel.json +++ b/vercel.json @@ -1,4 +1,14 @@ { + "builds": [ + { + "src": "build/public/**", + "use": "@vercel/static" + }, + { + "src": "build/server.js", + "use": "@vercel/node" + } + ], "rewrites": [ { "source": "/static/(.*)", "destination": "build/public/static/$1" }, { "source": "/(.*).(png|jpg|svg|gif)", "destination": "build/public/$1" }, From 7a1b9027282089031fe9007c06ca650d3916410d Mon Sep 17 00:00:00 2001 From: Gunnar Velle Date: Fri, 23 Jun 2023 10:14:57 +0200 Subject: [PATCH 4/4] unused props --- vercel.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/vercel.json b/vercel.json index 8208b9356c..da1542a7e3 100644 --- a/vercel.json +++ b/vercel.json @@ -28,14 +28,11 @@ "env": { "NDLA_EDITORIAL_CLIENT_ID": "@ndla_editorial_client_id", "NDLA_EDITORIAL_CLIENT_SECRET": "@ndla_editorial_client_secret", - "NDLA_GOOGLE_API_KEY": "@ndla_google_api_key", - "NDLA_GOOGLE_SEARCH_ENGINE_ID": "@ndla_google_search_engine_id", "NDLA_PERSONAL_CLIENT_ID": "@ndla_personal_client_id", "BRIGHTCOVE_PLAYER_ID": "@brightcove_player_id", "BRIGHTCOVE_ACCOUNT_ID": "@brightcove_account_id", "BRIGHTCOVE_API_CLIENT_ID": "@brightcove_api_client_id", "BRIGHTCOVE_API_CLIENT_SECRET": "@brightcove_api_client_secret", - "NPK_TOKEN": "@npk_token", "NDLA_ED_ZENDESK_WIDGET_KEY": "@ndla_ed_zendesk_widget_key", "NDLA_ED_ZENDESK_WIDGET_SECRET": "@ndla_ed_zendesk_widget_secret" }