]> git.ardis.lu - ardislu.dev/commitdiff
Replace google-api-proxy with Cloudflare Function
authorArdis Lu <ardisglu@gmail.com>
Fri, 25 Mar 2022 07:12:02 +0000 (00:12 -0700)
committerArdis Lu <ardisglu@gmail.com>
Fri, 25 Mar 2022 07:12:02 +0000 (00:12 -0700)
script.js

index e69efb5661da06d0cd957370530c97720ec40ddb..966cdf3c778932204b234d145a06c34117ca6389 100644 (file)
--- 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 = {
This page took 0.037774 seconds and 4 git commands to generate.