Skip to content

Commit 32dba98

Browse files
committed
builder
1 parent 1f03dca commit 32dba98

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"license": "MIT",
1515
"dependencies": {
16+
"@netlify/functions": "^0.11.0",
1617
"@vercel/ncc": "^0.33.1",
1718
"cloudinary": "^1.27.1",
1819
"fs-extra": "^10.0.0",

src/templates/functions/cld_images.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
const { builder } = require('@netlify/functions');
2+
13
const { getQueryParams } = require('../../lib/util');
24
const { configureCloudinary, getCloudinaryUrl } = require('../../lib/cloudinary');
35
const { PUBLIC_ASSET_PATH } = require('../../data/cloudinary');
46

5-
exports.handler = async function (event, context) {
7+
async function handler(event, context) {
68
const { rawUrl, headers } = event;
79
const { host } = headers;
810

@@ -37,4 +39,6 @@ exports.handler = async function (event, context) {
3739
Location: cloudinaryUrl
3840
}
3941
};
40-
};
42+
};
43+
44+
exports.handler = builder(handler);

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,13 @@
487487
"@types/yargs" "^16.0.0"
488488
chalk "^4.0.0"
489489

490+
"@netlify/functions@^0.11.0":
491+
version "0.11.0"
492+
resolved "https://registry.yarnpkg.com/@netlify/functions/-/functions-0.11.0.tgz#224f3bba53809b364d36377ad0b2d3de594f994d"
493+
integrity sha512-+WWX081UCkLZYkfh1Ru+PH5HTujNXugeskATGhZLTyS1U3Cqh2gYLArdG1a/vU8WWopu/wjpxEOdWq8/T5Nw5Q==
494+
dependencies:
495+
is-promise "^4.0.0"
496+
490497
"@sinonjs/commons@^1.7.0":
491498
version "1.8.3"
492499
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d"
@@ -1392,6 +1399,11 @@ is-potential-custom-element-name@^1.0.1:
13921399
resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5"
13931400
integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==
13941401

1402+
is-promise@^4.0.0:
1403+
version "4.0.0"
1404+
resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3"
1405+
integrity sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==
1406+
13951407
is-stream@^2.0.0:
13961408
version "2.0.1"
13971409
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077"

0 commit comments

Comments
 (0)