From 983a86717d290ea572b8850b3e74a8d8cea0b258 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Fri, 25 Mar 2022 00:12:02 -0700 Subject: [PATCH] Replace google-api-proxy with Cloudflare Function --- script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index e69efb5..966cdf3 100644 --- a/script.js +++ b/script.js @@ -49,7 +49,7 @@ postLoader.insertAdjacentHTML('beforeend', /* Call the CMS controller to get all post metadata. Note: must call fetchPostContent to get content. */ async function fetchPostMetadata() { - const proxyUrl = 'https://script.google.com/macros/s/AKfycbzMHxwypbwsccBq6RH8LDCAOpM02C4gbkljbcKHKFsoQTRE-f4XTIyswiaO0vshs-Kr/exec'; + const proxyUrl = '/api'; const controllerId = '1pfGF8yBu3D0GPTezygLuzu3Cif8SkjhtG98nL-czlhc'; const range = 'B3:I'; const url = `${proxyUrl}?https://sheets.googleapis.com/v4/spreadsheets/${controllerId}/values/${range}`; @@ -75,7 +75,7 @@ async function fetchPostMetadata() { /* Get content for the given path */ async function fetchPostContent(path) { const post = posts.get(path); - const proxyUrl = 'https://script.google.com/macros/s/AKfycbzMHxwypbwsccBq6RH8LDCAOpM02C4gbkljbcKHKFsoQTRE-f4XTIyswiaO0vshs-Kr/exec'; + const proxyUrl = '/api'; const url = `${proxyUrl}?https://docs.googleapis.com/v1/documents/${post.id}`; const mapping = { -- 2.47.3