1.0.0 • Published 2 years ago

@itlife/strapi-provider-upload-customapi v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Strapi : Provider Upload with Custom API

Support : strapi v.4.8.0

Config ==> upload provider

**./config/plugins.js**

module.exports = ({ env }) => ({
  ...,
  upload: {
    config: {
      provider: "strapi-provider-upload-customapi",
      providerOptions: {
        endpoint: "https://api.com/upload-files",
        module: "customapi",
        fileParameterName: "file",
        headers: {},
      },
    },
  },
});

Config ==> strapi::security

**./config/middlewares.js**

module.exports = [
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': ["'self'", 'data:', 'blob:', 'custom-api.com'],
          'media-src': ["'self'", 'data:', 'blob:', 'custom-api.com'],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  'strapi::errors',
  'strapi::cors',
  'strapi::poweredBy',
  'strapi::logger',
  'strapi::query',
  'strapi::body',
  'strapi::session',
  'strapi::favicon',
  'strapi::public',
];
1.0.0

2 years ago