A thumbnail generator example using Minio's listenBucketNotification API
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Fix documentation and allow printing a nicer help for webhook. Feb 22, 2017
.gitignore Initial commit Jan 7, 2017
LICENSE
README.md Remove yarn dependency Mar 26, 2018
package-lock.json Remove yarn dependency Mar 26, 2018
package.json Remove yarn dependency Mar 26, 2018
thumbnail-webhook.js Fix documentation and allow printing a nicer help for webhook. Feb 22, 2017
thumbnail.js

README.md

Thumbnailer

A thumbnail generator example using Minio's listenBucketNotification API. This is a simple example of how one can build a AWS Lambda like functionality on a laptop.

Dependencies

Dependencies are managed by npm use npm install.

npm install

Configure

Please edit config/development.json with your local parameters, currently the example points to https://play.minio.io:9000

This example works only with Minio server using an extended API

Run

Once configured proceed to run.

node thumbnail.js
Listening for events on "images"

Now upload an image using mc

mc cp ./toposort/graph.jpg play/images/
./toposort/graph.jpg:  34.29 KB / 34.29 KB ┃▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓┃ 100.00% 386.91 KB/s 0s

You will see thumbnail being generated after uploading the image using mc.

node thumbnail.js
Listening for events on "images"
Uploading new thumbail to "images-processed"
Successfully generated "graph-thumbnail.jpg" with md5sum "ca78ee1cc48358b4dbd883a589523e54"

To validate if the thumbnail was created at destination bucket use mc.

mc ls play/images-processed
[2017-01-22 23:44:51 PST]   629B graph-thumbnail.jpg