npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pixelbin/strapi-provider-upload

v1.0.2

Published

Pixelbin provider for strapi upload

Downloads

90

Readme

Strapi Upload Provider for Pixelbin.io

works with Strapi 4.


PixelBin.io: https://www.pixelbin.io/

Docs: https://www.pixelbin.io/docs/

Pre-install: create Pixelbin.io account.

Installation

# using npm
npm install @pixelbin/strapi-provider-upload --save

Parameters

| Parameter | Description | Example | | ------------- | ------------- | ------------- | | PIXELBIN_SECRET | api secret | a89a57f1-09f3-4z56-a282-4a746ce6cb6e | | folderName | Default path | "strapi-images" |

Example

:zero:

Create Strapi project: (docs).

After successfully creating the project stop the dev server: CTRL + C.

:one:

Install upload plugin: npm install @pixelbin/strapi-provider-upload --save.

NOTE: Be sure that you are in a folder with your Strapi project: cd strapi-pixelbin-cloud-project.

After successful installation your package.json file will have a code:

"dependencies": {
    ...
    "@pixelbin/strapi-provider-upload": "^1.0.2",
    ...
  },

:two:

Go to code editor to your project folder and create config file for your bucket: ./config/plugins.js (file plugins.js in config folder in the root of your Strapi project) with the code:

Strapi v4:

module.exports = ({ env }) => ({
  upload: {
    config: {
      provider: "@pixelbin/strapi-provider-upload",
      providerOptions: {
        apiSecret: env("PIXELBIN_SECRET"),
        folderName: "strapi-images", //you can changes folder name anything you want
      },
      actionOptions: {
        upload: {},
        delete: {},
      },
    },
  },
});

Strapi v4: Security Middleware Configuration

Go to code editor to your project folder and create config file for your bucket: ./config/middlewares.js (file middlewares.js in config folder in the root of your Strapi project) with the code:


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

:three:

Create a .env file in the root of your Strapi project.

Example of .env.local:

HOST=0.0.0.0
PORT=1337

PIXELBIN_SECRET=a89a57f1-09f3-4z56-a282-4a746ce6cb6e

:four:

Test the new uploader.

  1. Start Strapi dev server: npm run develop.

  2. Open Strapi media library v4 in a browser and upload a test image.