From 3c9329282765b5dd04fdae324c371b4d0fc1db56 Mon Sep 17 00:00:00 2001 From: Joel Hooks Date: Sat, 4 Apr 2020 16:10:30 -0700 Subject: [PATCH] just use fetch I guess --- .../process-url/node_modules/.yarn-integrity | 10 +++++++ functions/process-url/package.json | 4 +-- functions/process-url/process-url.js | 26 ------------------- functions/process-url/yarn.lock | 17 ------------ 4 files changed, 11 insertions(+), 46 deletions(-) create mode 100644 functions/process-url/node_modules/.yarn-integrity diff --git a/functions/process-url/node_modules/.yarn-integrity b/functions/process-url/node_modules/.yarn-integrity new file mode 100644 index 0000000..5e070b6 --- /dev/null +++ b/functions/process-url/node_modules/.yarn-integrity @@ -0,0 +1,10 @@ +{ + "systemParams": "darwin-x64-72", + "modulesFolders": [], + "flags": [], + "linkedModules": [], + "topLevelPatterns": [], + "lockfileEntries": {}, + "files": [], + "artifacts": {} +} \ No newline at end of file diff --git a/functions/process-url/package.json b/functions/process-url/package.json index 0e6491a..b096485 100644 --- a/functions/process-url/package.json +++ b/functions/process-url/package.json @@ -4,7 +4,5 @@ "main": "index.js", "author": "christopherbiscardi (@chrisbiscardi)", "license": "MIT", - "dependencies": { - "cloudinary": "^1.20.0" - } + "dependencies": {} } diff --git a/functions/process-url/process-url.js b/functions/process-url/process-url.js index 01002db..805f3ec 100644 --- a/functions/process-url/process-url.js +++ b/functions/process-url/process-url.js @@ -1,28 +1,8 @@ -const cloudinary = require('cloudinary').v2 const qs = require('querystring') -cloudinary.config({ - cloud_name: process.env.CLOUD_NAME, - api_key: process.env.CLOUDINARY_KEY, - api_secret: process.env.CLOUDINARY_SECRET, -}) exports.handler = async function (event, ctx) { const {queryStringParameters} = event - console.log(queryStringParameters) try { - // https://res.cloudinary.com/dg3gyk0gu/image/upload/v1586032616/og-images/pixel.png - // const imageUrl = cloudinary.url(`v1586034934/og_images/pixel_zeddhz.png`, { - // // resouce_type: "raw" - // sign_url: true, - // // secure: true, - // custom_pre_function: { - // function_type: 'remote', - // source: `https://competent-goodall-d71d0d.netlify.com/.netlify/functions/gen-opengraph-image?${qs.stringify( - // queryStringParameters, - // )}`, - // }, - // }) - const imageUrl = `https://res.cloudinary.com/${ process.env.CLOUD_NAME }/image/fetch/${encodeURIComponent( @@ -30,12 +10,6 @@ exports.handler = async function (event, ctx) { queryStringParameters, )}`, )}` - - console.log( - `https://competent-goodall-d71d0d.netlify.com/.netlify/functions/gen-opengraph-image?${qs.stringify( - queryStringParameters, - )}`, - ) return { statusCode: 302, headers: { diff --git a/functions/process-url/yarn.lock b/functions/process-url/yarn.lock index 8f4501c..fb57ccd 100644 --- a/functions/process-url/yarn.lock +++ b/functions/process-url/yarn.lock @@ -2,20 +2,3 @@ # yarn lockfile v1 -cloudinary@^1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/cloudinary/-/cloudinary-1.20.0.tgz#88f3964be91cc9808b5c7834bf06e03d22954636" - integrity sha512-/e76lEr5PS5gefvWUJ2Ou90zuEQCc0agTq8hrx2uxfFhUGlzEQ9mPPcwAeHFY1gj9caq0iHLuvTDvBbLSRhX9w== - dependencies: - lodash "^4.17.11" - q "^1.5.1" - -lodash@^4.17.11: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== - -q@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=