@innovorder/serverless-resize-bucket-images

    2.1361.0 • Public • Published

    How it works

    When an image is uploaded to the bucket and his path contains toBeResized (uploads/<brand_id/brand_hash>/toBeResized/image1.png), the image resizer Cloud Function resizes and compress it. When the job is done, the new image is uploaded to the same path extracting the toBeResized part (uploads/<brand_id/brand_hash>/image1.png).

    Local development

    You need to set (or create in a .env file) a GOOGLE_APPLICATION_CREDENTIALS environment variable with the path to your Google Storage credentials.

    Use yarn start to load a local hot reloaded instance of the Cloud Function. The instance listens on http://localhost:8080. You must do a POST request to simulate an event (https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/master/docs/events.md). To test inputs you must send a body with data as it follows:

    {
        "data": {
            "bucket": "static-dev.innovorder.fr",
            "name": "uploads/toBeResized/test-image.png"
        }
    }

    Deployment

    IMPORTANT

    Remove eslint-config-innovorder package before deploying. Cloud function deployment tries to install devDependencies also (which is not normal) and it will not found this package.

    Requirements

    Install Google Cloud SDK in your system and authenticate with gcloud (https://cloud.google.com/sdk/docs/authorizing#running_gcloud_auth_login).

    To deploy an specific version, just checkout this repository and run yarn deploy-<environment_name>, where environment_name can be dev, preprod or prod.

    Logging

    To see the deployed Cloud Function logs use yarn logs-<environment_name>

    Keywords

    none

    Install

    npm i @innovorder/serverless-resize-bucket-images

    DownloadsWeekly Downloads

    8,353

    Version

    2.1361.0

    License

    MIT

    Unpacked Size

    572 kB

    Total Files

    26

    Last publish

    Collaborators

    • fredericespiau
    • bcohen-io
    • eladssaouiachraf
    • nw_ussama
    • thomasdeligny
    • mouhcinejebrane
    • rindra-innovorder
    • berrada
    • innovorder-hgouillard
    • io-gilles
    • titouan.innovorder
    • tplassart
    • olivier-loverde
    • yannsheriff
    • quentin-fritz
    • inno-ci
    • ericzered
    • kdescamps
    • virgile-innovorder
    • zeroual
    • ykmet-io
    • jean1591
    • axeljo