Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding cloudinary to strapi

Can someone tell me how to install Cloudinary to my Strapi app, I installed the plugin like the documentation said but the plugin doesn't show up at all in my project. Can someone tell me what im doing wrong

like image 547
GentiJ Avatar asked May 13 '20 09:05

GentiJ


People also ask

What is Strapi API?

Strapi is an open-source headless CMS used for building fast and easily manageable APIs written in JavaScript. It enables developers to make flexible API structures easily using a beautiful user interface. Strapi can be used with various databases including MongoDB, PostgreSQL, etc.


1 Answers

There is an example on the strapi documentation: https://strapi.io/documentation/3.0.0-beta.x/plugins/upload.html#using-a-provider To enable the provider for Cloudinary, create or edit the file at ./extensions/upload/config/settings.json

{
  "provider": "cloudinary",
  "providerOptions": {     "cloud_name":"PROVIDER_CLOUD_NAME",
    "api_key": "PROVIDER_API_KEY",               
    "api_secret":"PROVIDER_API_SECRET"
  }
}

Of course you should replace PROVIDER_CLOUD_NAME, PROVIDER_API_KEY, PROVIDER_API_SECRET with appropriate values that can be found on your Cloudinary account. If you want a specific configuration by environment you can edit the file at ./extensions/upload/config/settings.js like this:

if (process.env.NODE_ENV === 'production') {
  module.exports = {
    provider: 'providerName',
    providerOptions: {
      cloud_name: process.env.PROVIDER_CLOUD_NAME,
      api_key: process.env.PROVIDER_API_KEY,
      api_secret: process.env.PROVIDER_API_SECRET
    }
  };
} else {
  // to use the default local provider you can return an empty configuration
  module.exports = {};
}
like image 186
adrianmr Avatar answered Oct 21 '22 20:10

adrianmr