I would like to use cloudinary API from Angular fronted.
I followed this one by intalling npm install cloudinary
https://cloudinary.com/documentation/node_integration
I called in cloudianryAPI instead of cloudinary because I already have the same variable from other widgets that I used by them
import { v2 as cloudinaryAPI } from 'cloudinary'
cloudinaryAPI.config({
cloud_name: 'dmruay7we',
api_key: '599663769358526',
api_secret: '5xzdnxEmcXpFfZOPoxoE0hvBiCY',
secure: true
});
cloudinaryAPI.api
.delete_resources_by_tag('pickup')
.then(result=>console.log(result));
This one errors with a super long error:
ERROR in ./node_modules/cloudinary/lib-es5/api_client/execute_request.js 17:52-67
Module not found: Error: Can't resolve 'http' in 'C:\Users\blazi\Desktop\Projects\recyswiss\node_modules\cloudinary\lib-es5\api_client'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }
I cried their curl example too but even the curl tester does not seem to work:
https://cloudinary.com/documentation/admin_api#delete_resources_by_tags
curl
-X DELETE
https://599663769358526:[email protected]/v1_1/dmruay7we/resources/image/tags/pickup
I am at a loss at how to successfully call their API from Angular
Learn how to upload files with only a few lines of Node.js code, including cloud storage, CDN delivery, and dynamic effects for images and media.
Run, save, and collaborate Curl commands directly from your browser. Test APIs, websites, and web services and validate server responses without installing additional software or plugins. Learn Curl with an extensive database of handpicked Curl examples. See why 850,000 users use ReqBin online Curl Client for testing their APIs online!
Programmatically and securely control of all uploaded raw files, images, videos, fetched social profile pictures, generated transformations and more.